Pin drive mode

group group_gpio_driveModes

Constants to be used for setting the drive mode of the pin.

There are eight primary drive modes. Below diagrams are simplified output driver diagrams of the pin view for the CPU register and UDB/DSI based digital peripherals on each of the eight drive modes. ../../../_images/gpio_cpu_dm_block_diagram.png

Below is a simplified output driver diagram that shows the pin view for fixed-function-based peripherals for each of the eight drive modes. ../../../_images/gpio_periio_dm_block_diagram.png

  • High-Impedance: This is the standard high-impedance (HI-Z) state recommended for analog and digital inputs. For digital signals, the input buffer is enabled; for analog signals, the input buffer is typically disabled to reduce crowbar current and leakage in low-power designs. To achieve the lowest device current, unused GPIOs must be configured to the high-impedance drive mode with input buffer disabled. Highimpedance drive mode with input buffer disabled is also the default pin reset state.

  • Resistive Pull-Up or Resistive Pull-Down: Resistive modes provide a series resistance in one of the data states and strong drive in the other. Pins can be used for either digital input or digital output in these modes. If resistive pull-up is required, a ‘1’ must be written to that pin’s Data Register bit. If resistive pull-down is required, a ‘0’ must be written to that pin’s Data Register. Interfacing mechanical switches is a common application of these drive modes. The resistive modes are also used to interface PSoC with open drain drive lines. Resistive pull-up is used when the input is open drain low and resistive pull-down is used when the input is open drain high.

  • Open Drain Drives High and Open Drain Drives Low: Open drain modes provide high impedance in one of the data states and strong drive in the other. Pins are useful as digital inputs or outputs in these modes. Therefore, these modes are widely used in bidirectional digital communication. Open drain drive high mode is used when the signal is externally pulled down and open drain drive low is used when the signal is externally pulled high. A common application for the open drain drives low mode is driving I2C bus signal lines.

  • Strong Drive: The strong drive mode is the standard digital output mode for pins; it provides a strong CMOS output drive in both high and low states. Strong drive mode pins should not be used as inputs under normal circumstances. This mode is often used for digital output signals or to drive external devices.

  • Resistive Pull-Up and Resistive Pull-Down: In the resistive pull-up and pull-down mode, the GPIO will have a series resistance in both logic 1 and logic 0 output states. The high data state is pulled up while the low data state is pulled down. This mode is useful when the pin is driven by other signals that may cause shorts.

Defines

CY_GPIO_DM_ANALOG

Analog High-Z.

Input buffer off

CY_GPIO_DM_INVALID_IN_OFF

Invalid mode.

It should not be used

CY_GPIO_DM_PULLUP_IN_OFF

Resistive Pull-Up.

Input buffer off

CY_GPIO_DM_PULLDOWN_IN_OFF

Resistive Pull-Down.

Input buffer off

CY_GPIO_DM_OD_DRIVESLOW_IN_OFF

Open Drain, Drives Low.

Input buffer off

CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF

Open Drain, Drives High.

Input buffer off

CY_GPIO_DM_STRONG_IN_OFF

Strong Drive.

Input buffer off

CY_GPIO_DM_PULLUP_DOWN_IN_OFF

Resistive Pull-Up/Down.

Input buffer off

CY_GPIO_DM_HIGHZ

Digital High-Z.

Input buffer on

CY_GPIO_DM_INVALID

Invalid mode.

It should not be used

CY_GPIO_DM_PULLUP

Resistive Pull-Up.

Input buffer on

CY_GPIO_DM_PULLDOWN

Resistive Pull-Down.

Input buffer on

CY_GPIO_DM_OD_DRIVESLOW

Open Drain, Drives Low.

Input buffer on

CY_GPIO_DM_OD_DRIVESHIGH

Open Drain, Drives High.

Input buffer on

CY_GPIO_DM_STRONG

Strong Drive.

Input buffer on

CY_GPIO_DM_PULLUP_DOWN

Resistive Pull-Up/Down.

Input buffer on