<?xml version="1.0" encoding="utf-8"?> <!--**************************************************************************** * \file pin.cypersonality * \version 1.1 * * \brief * Pin 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="mxs40pin" name="Pin" version="1.1" path="Pin" xmlns="http://cypress.com/xsd/cyhwpersonality_v1"> <Dependencies> <IpBlock name="mxs40ioss" /> <Resource name="ioss\.port\.pin" used="true" /> </Dependencies> <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__gpio.html" linkText="Open GPIO Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" /> <!--General--> <ParamChoice id="DriveModes" name="Drive Mode" group="General" default="CY_GPIO_DM_ANALOG" visible="true" editable="true" desc="The Drive Mode parameter configures the pin provide to one of the eight available pin drive modes. Please see the device DS for more details on each drive mode." > <Entry name="Strong Drive. Input buffer on" value="CY_GPIO_DM_STRONG" visible="true" /> <Entry name="Strong Drive. Input buffer off" value="CY_GPIO_DM_STRONG_IN_OFF" visible="true" /> <Entry name="Open Drain, Drives Low. Input buffer off" value="CY_GPIO_DM_OD_DRIVESLOW_IN_OFF" visible="true" /> <Entry name="Open Drain, Drives High. Input buffer off" value="CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF" visible="true" /> <Entry name="Open Drain, Drives Low. Input buffer on" value="CY_GPIO_DM_OD_DRIVESLOW" visible="true" /> <Entry name="Open Drain, Drives High. Input buffer on" value="CY_GPIO_DM_OD_DRIVESHIGH" visible="true" /> <Entry name="Resistive Pull-Up. Input buffer off" value="CY_GPIO_DM_PULLUP_IN_OFF" visible="true" /> <Entry name="Resistive Pull-Down. Input buffer off" value="CY_GPIO_DM_PULLDOWN_IN_OFF" visible="true" /> <Entry name="Resistive Pull-Up/Down. Input buffer off" value="CY_GPIO_DM_PULLUP_DOWN_IN_OFF" visible="true" /> <Entry name="Resistive Pull-Up. Input buffer on" value="CY_GPIO_DM_PULLUP" visible="true" /> <Entry name="Resistive Pull-Down. Input buffer on" value="CY_GPIO_DM_PULLDOWN" visible="true" /> <Entry name="Resistive Pull-Up/Down. Input buffer on" value="CY_GPIO_DM_PULLUP_DOWN" visible="true" /> <Entry name="Digital High-Z. Input buffer on" value="CY_GPIO_DM_HIGHZ" visible="true" /> <Entry name="Analog High-Z. Input buffer off" value="CY_GPIO_DM_ANALOG" visible="true" /> </ParamChoice> <ParamChoice id="initialState" name="Initial Drive State" group="General" default="1" visible="true" editable="true" desc="This parameter specifies the pin-specific initial value written to the pin's OUT Register after a device reset/power-on." > <Entry name="High (1)" value="1" visible="true" /> <Entry name="Low (0)" value="0" visible="true" /> </ParamChoice> <!--Misc--> <ParamBool id="hasSIO" name="HasSIO" group="Misc" default="`${lookupExpression("GPIO.GPIO_PORT_NR[" . getInstNumber("port") . "].GPIO_PRT.SIO") > 0}`" visible="false" editable="false" desc="Has SIO" /> <!--Input--> <ParamChoice id="vtrip" name="Threshold" group="Input" default="CY_GPIO_VTRIP_CMOS" visible="true" editable="true" desc="This parameter selects the threshold levels that define a logic high level (1) and a logic low level (0)." > <Entry name="CMOS" value="CY_GPIO_VTRIP_CMOS" visible="true" /> <Entry name="TTL" value="CY_GPIO_VTRIP_TTL" visible="true" /> </ParamChoice> <ParamChoice id="isrTrigger" name="Interrupt Trigger Type" group="Input" default="CY_GPIO_INTR_DISABLE" visible="true" editable="true" desc="This parameter selects whether the pin can generate an interrupt and, if selected, the interrupt type." > <Entry name="None" value="CY_GPIO_INTR_DISABLE" visible="true" /> <Entry name="Rising Edge" value="CY_GPIO_INTR_RISING" visible="true" /> <Entry name="Falling Edge" value="CY_GPIO_INTR_FALLING" visible="true" /> <Entry name="Both Edges" value="CY_GPIO_INTR_BOTH" visible="true" /> </ParamChoice> <ParamBool id="sioInputBuffer" name="SIO Input Buffer Differential" group="Input" default="false" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects the input buffer mode" /> <ParamChoice id="sioTrip" name="SIO Input Buffer Trip Mode" group="Input" default="CY_SIO_VTRIP_CMOS" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects the input buffer trip-point in single ended input buffer mode." > <Entry name="CMOS (single-ended)" value="CY_SIO_VTRIP_CMOS" visible="true" /> <Entry name="TTL (single-ended)" value="CY_SIO_VTRIP_TTL" visible="true" /> <Entry name="0.5xVddio or 0.5xVoh (differential)" value="CY_SIO_VTRIP_0_5VDDIO_0_5VOH" visible="true" /> <Entry name="0.4xVddio or 0.4xVoh (differential)" value="CY_SIO_VTRIP_0_4VDDIO_1_0VREF" visible="true" /> </ParamChoice> <ParamChoice id="sioRef" name="SIO Reference Voltage" group="Input" default="CY_SIO_VREF_PINREF" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects reference voltage (Vref) trip-point of the input buffer." > <Entry name="Analog Pin" value="CY_SIO_VREF_PINREF" visible="true" /> <Entry name="Internal 1.2V Reference" value="CY_SIO_VREF_1_2V" visible="true" /> <Entry name="AMUXBUS A" value="CY_SIO_VREF_AMUX_A" visible="true" /> <Entry name="AMUXBUS B" value="CY_SIO_VREF_AMUX_B" visible="true" /> </ParamChoice> <ParamChoice id="sioVoltage" name="Regulated Output Voltage Level (Voh)" group="Input" default="CY_SIO_VOH_1_00" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects the regulated Voh output level and trip point of the input buffer for a specific SIO pin pair. Voh depends on the selected reference voltage." > <Entry name="1 x Reference" value="CY_SIO_VOH_1_00" visible="true" /> <Entry name="1.25 x Reference" value="CY_SIO_VOH_1_25" visible="true" /> <Entry name="1.49 x Reference" value="CY_SIO_VOH_1_49" visible="true" /> <Entry name="1.67 x Reference" value="CY_SIO_VOH_1_67" visible="true" /> <Entry name="2.08 x Reference" value="CY_SIO_VOH_2_08" visible="true" /> <Entry name="2.50 x Reference" value="CY_SIO_VOH_2_50" visible="true" /> <Entry name="2.78 x Reference" value="CY_SIO_VOH_2_78" visible="true" /> <Entry name="4.16 x Reference" value="CY_SIO_VOH_4_16" visible="true" /> </ParamChoice> <!--Output--> <ParamChoice id="slewRate" name="Slew Rate" group="Output" default="CY_GPIO_SLEW_FAST" visible="true" editable="true" desc="The slew rate parameter determines the rise and fall ramp rate for the pin as it changes output logic levels." > <Entry name="Fast" value="CY_GPIO_SLEW_FAST" visible="true" /> <Entry name="Slow" value="CY_GPIO_SLEW_SLOW" visible="true" /> </ParamChoice> <ParamChoice id="driveStrength" name="Drive Strength" group="Output" default="CY_GPIO_DRIVE_1_2" visible="true" editable="true" desc="Drive strength can be defined to select how much of the IO driver is enabled to provide additional control of the rising and falling edge slew rates." > <Entry name="Full" value="CY_GPIO_DRIVE_FULL" visible="true" /> <Entry name="1 / 2" value="CY_GPIO_DRIVE_1_2" visible="true" /> <Entry name="1 / 4" value="CY_GPIO_DRIVE_1_4" visible="true" /> <Entry name="1 / 8" value="CY_GPIO_DRIVE_1_8" visible="true" /> </ParamChoice> <ParamBool id="sioOutputBuffer" name="SIO Output Buffer Regulated" group="Output" default="true" visible="`${hasSIO && DigitalOutput}`" editable="true" desc="Selects the output buffer mode" /> <!--Internal Connection--> <ParamSignal port="analog[0]" name="Analog" group="Internal Connection" visible="`${hasVisibleOption("analog[0]")}`" desc="An analog signal to connect to" canBeEmpty="true" /> <ParamSignal port="digital_in[0]" name="Digital Input" group="Internal Connection" visible="`${hasVisibleOption("digital_in[0]")}`" desc="A digital input signal to connect to" canBeEmpty="true" /> <ParamSignal port="digital_out[0]" name="Digital Output" group="Internal Connection" visible="`${hasVisibleOption("digital_out[0]")}`" desc="A digital output signal to connect to" canBeEmpty="true" /> <ParamSignal port="digital_inout[0]" name="Digital InOut" group="Internal Connection" visible="`${hasVisibleOption("digital_inout[0]")}`" desc="A digital inout signal to connect to" canBeEmpty="true" /> <ParamSignal port="aux[0]" name="AUX" group="Internal Connection" visible="`${hasVisibleOption("aux[0]")}`" desc="A fixed function signal to connect to" canBeEmpty="true" /> <ParamSignal port="oe[0]" name="OE" group="Internal Connection" visible="`${hasVisibleOption("oe[0]")}`" desc="The Output Enable terminal." canBeEmpty="true" /> <!-- Skip amuxbus code gen --> <ParamString id="analogValue" name="Analog Connection Value" group="Internal" default="`${hasConnection("analog", 0) ? getBlockFromSignal("analog[0]") : ""}`" visible="false" editable="false" desc="" /> <ParamBool id="skipConfigCodeGen" name="Skip Configuration Code Gen" group="Internal" default="`${hasConnection("analog", 0) && hasExposedMember(analogValue, "suppressCodeGen") && getExposedMember(analogValue, "suppressCodeGen")}`" visible="false" editable="false" desc="Whether configuration code generation should be skipped" /> <!--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)." /> <ParamBool id="hasDigitalConnection" name="Has digital connection" group="Internal" default="`${hasConnection("digital_in", 0) || hasConnection("digital_out", 0) || hasConnection("digital_inout", 0)}`" visible="false" editable="false" desc="" /> <ParamRange id="port" name="Port number" group="Internal" default="`${getInstNumber("port")}`" min="0" max="127" resolution="1" visible="false" editable="false" desc="" /> <ParamRange id="pin" name="Pin number" group="Internal" default="`${getInstNumber("pin")}`" min="0" max="7" resolution="1" visible="false" editable="false" desc="" /> <ParamString id="blockName" name="Block name" group="Internal" default="`${"ioss_0_port_" . port . "_pin_" . pin}`" visible="false" editable="false" desc="" /> </Parameters> <DRCs> <!--sioOutputBuffer DRCs--> <DRC type="WARNING" text="The SIO Output Buffer Regulated mode is selected ONLY if the Drive Mode is set to the "Open Drain, Drives High. Input buffer off" mode. If the Drive Mode is set to any other mode the regulated output buffer will be disabled and the standard CMOS output buffer is used." condition="`${hasSIO && sioOutputBuffer && (DriveModes ne CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF)}`" /> <DRC type="ERROR" text="The digital_in terminal cannot be connected when the digital_inout terminal is connected." condition="`${hasConnection("digital_in", 0) && hasConnection("digital_inout", 0)}`" /> <DRC type="ERROR" text="The digital_out terminal cannot be connected when the digital_inout terminal is connected." condition="`${hasConnection("digital_out", 0) && hasConnection("digital_inout", 0)}`" /> <DRC type="WARNING" paramId="driveStrength" text="To limit noise, full drive strength is not recommended " condition="`${(driveStrength eq CY_GPIO_DRIVE_FULL)}`" > <FixIt action="SET_PARAM" target="driveStrength" value="CY_GPIO_DRIVE_1_2" valid="true" /> </DRC> </DRCs> <ConfigFirmware> <ConfigInclude value="cy_gpio.h" include="true" /> <ConfigInclude value="cycfg_routing.h" include="`${hasDigitalConnection}`" /> <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" /> <ConfigDefine name="`${INST_NAME}`_PORT" value="GPIO_PRT`${port}`" public="true" include="true" /> <ConfigDefine name="`${INST_NAME}`_PORT_NUM" value="`${port}`U" public="true" include="true" /> <ConfigDefine name="`${INST_NAME}`_PIN" value="`${pin}`U" public="true" include="true" /> <ConfigDefine name="`${INST_NAME}`_NUM" value="`${pin}`U" public="true" include="true" /> <ConfigDefine name="`${INST_NAME}`_DRIVEMODE" value="`${DriveModes}`" public="true" include="true" /> <ConfigDefine name="`${INST_NAME}`_INIT_DRIVESTATE" value="`${initialState}`" public="true" include="true" /> <ConfigDefine name="`${blockName . "_HSIOM"}`" value="HSIOM_SEL_GPIO" public="true" include="true" preventOverride="true" /> <ConfigDefine name="`${INST_NAME}`_HSIOM" value="`${blockName . "_HSIOM"}`" public="true" include="`${!(INST_NAME eq blockName)}`" /> <ConfigDefine name="`${INST_NAME}`_IRQ" value="ioss_interrupts_gpio_`${port}`_IRQn" public="true" include="true" /> <ConfigDefine name="`${INST_NAME}`_HAL_PORT_PIN" value="P`${port}`_`${pin}`" public="true" include="true" guard="defined (CY_USING_HAL)"/> <ConfigDefine name="`${INST_NAME}`" value="P`${port}`_`${pin}`" public="true" include="true" guard="defined (CY_USING_HAL)" /> <ConfigDefine name="`${INST_NAME}`_HAL_IRQ" value="`${(isrTrigger eq CY_GPIO_INTR_DISABLE) ? "CYHAL_GPIO_IRQ_NONE" : (isrTrigger eq CY_GPIO_INTR_RISING) ? "CYHAL_GPIO_IRQ_RISE" : (isrTrigger eq CY_GPIO_INTR_FALLING) ? "CYHAL_GPIO_IRQ_FALL" : "CYHAL_GPIO_IRQ_BOTH"}`" public="true" include="true" guard="defined (CY_USING_HAL)" /> <ConfigDefine name="`${INST_NAME}`_HAL_DIR" value="`${((DriveModes eq CY_GPIO_DM_HIGHZ) || (DriveModes eq CY_GPIO_DM_ANALOG)) ? "CYHAL_GPIO_DIR_INPUT " : ((DriveModes eq CY_GPIO_DM_STRONG_IN_OFF) || (DriveModes eq CY_GPIO_DM_OD_DRIVESLOW_IN_OFF) || (DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF) || (DriveModes eq CY_GPIO_DM_PULLUP_IN_OFF) || (DriveModes eq CY_GPIO_DM_PULLDOWN_IN_OFF) || (DriveModes eq CY_GPIO_DM_PULLUP_DOWN_IN_OFF)) ? "CYHAL_GPIO_DIR_OUTPUT " : "CYHAL_GPIO_DIR_BIDIRECTIONAL "}`" public="true" include="true" guard="defined (CY_USING_HAL)" /> <ConfigDefine name="`${INST_NAME}`_HAL_DRIVEMODE" value="`${(DriveModes eq CY_GPIO_DM_HIGHZ) ? "CYHAL_GPIO_DRIVE_NONE" : (DriveModes eq CY_GPIO_DM_ANALOG) ? "CYHAL_GPIO_DRIVE_ANALOG" : ((DriveModes eq CY_GPIO_DM_PULLUP_IN_OFF) || (DriveModes eq CY_GPIO_DM_PULLUP)) ? "CYHAL_GPIO_DRIVE_PULLUP" : ((DriveModes eq CY_GPIO_DM_PULLDOWN_IN_OFF) || (DriveModes eq CY_GPIO_DM_PULLDOWN)) ? "CYHAL_GPIO_DRIVE_PULLDOWN" : ((DriveModes eq CY_GPIO_DM_OD_DRIVESLOW_IN_OFF) || (DriveModes eq CY_GPIO_DM_OD_DRIVESLOW)) ? "CYHAL_GPIO_DRIVE_OPENDRAINDRIVESLOW" : ((DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF) || (DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH)) ? "CYHAL_GPIO_DRIVE_OPENDRAINDRIVESHIGH" : ((DriveModes eq CY_GPIO_DM_STRONG_IN_OFF) || (DriveModes eq CY_GPIO_DM_STRONG)) ? "CYHAL_GPIO_DRIVE_STRONG" : "CYHAL_GPIO_DRIVE_PULLUPDOWN"}`" public="true" include="true" guard="defined (CY_USING_HAL)" /> <ConfigStruct name="`${INST_NAME}`_config" type="cy_stc_gpio_pin_config_t" const="`${inFlash}`" public="true" include="true"> <Member name="outVal" value="`${initialState}`" /> <Member name="driveMode" value="`${DriveModes}`" /> <Member name="hsiom" value="`${INST_NAME}`_HSIOM" /> <Member name="intEdge" value="`${isrTrigger}`" /> <Member name="intMask" value="`${isrTrigger eq CY_GPIO_INTR_DISABLE ? 0 : 1}`UL" /> <Member name="vtrip" value="`${vtrip}`" /> <Member name="slewRate" value="`${slewRate}`" /> <Member name="driveSel" value="`${driveStrength}`" /> <Member name="vregEn" value="`${(!hasSIO) ? "0UL" : sioOutputBuffer ? "1UL" : "0UL"}`" /> <Member name="ibufMode" value="`${(!hasSIO) ? "0UL" : sioInputBuffer ? "1UL" : "0UL"}`" /> <Member name="vtripSel" value="`${hasSIO ? sioTrip : "0UL"}`" /> <Member name="vrefSel" value="`${hasSIO ? sioRef : "0UL"}`" /> <Member name="vohSel" value="`${hasSIO ? sioVoltage : "0UL"}`" /> </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_GPIO" /> <Member name="block_num" value="`${INST_NAME}`_PORT_NUM" /> <Member name="channel_num" value="`${INST_NAME}`_PIN" /> </ConfigStruct> <ConfigInstruction value="Cy_GPIO_Pin_Init(`${INST_NAME}`_PORT, `${INST_NAME}`_PIN, &`${INST_NAME}`_config);" include="`${!skipConfigCodeGen}`"/> <ConfigInstruction value="cyhal_hwmgr_reserve(&`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" /> </ConfigFirmware> </Personality>