1 Reply Latest reply on May 31, 2020 7:48 AM by LePo_1062026

    PSoC GPIO type switch


      Hi, Would you tell ,me how to switch GPIO type between digital output mode strong and input mode high impedance or input&output mode Open drain hi?

        • 1. Re: PSoC GPIO type switch



          Set the pin with the drive mode you want to have at power or reset.  This is the default mode the pin will have if you do nothing else.


          Look into the pins Datasheet.   You will find an API call Pin_SetDriveMode (uint8 drivemode)


          Here is where you can change the output drive characteristics or even change it to an input or have it as an input and an output (open-collector of course).


          Drive mode constants

          Constants to be passed as "mode" parameter in the Pin_SetDriveMode() function.

          Pins PSoC® Creator™ Component Datasheet

          Page 34 of 48 Document Number: 001-98278 Rev. *D


          • #define Pin_DM_ALG_HIZ (0x00u)   // High Impedance Analog.

          • #define Pin_DM_DIG_HIZ (0x01u)   // High Impedance Digital.

          • #define Pin_DM_RES_UP (0x02u)   // Resistive Pull Up.

          • #define Pin_DM_RES_DWN (0x03u)  // Resistive Pull Down.

          • #define Pin_DM_OD_LO (0x04u)    // Open Drain, Drives Low.

          • #define Pin_DM_OD_HI (0x05u)     // Open Drain, Drives High.

          • #define Pin_DM_STRONG (0x06u)   // Strong Drive.

          • #define Pin_DM_RES_UPDWN (0x07u)    // Resistive Pull Up/Down.



          1 of 1 people found this helpful