GPIO Pin Element

The GPIO pin element is used to read and write the state of a single pin.

The GPIO pin element is located in the Element Toolbox within Studio’s Embedded tab.

Properties

The following properties can be changed for the GPIO pin element:

Name

The name of the element.

Instance

The GPIO driver instance number to use. If unsure, leave it set to the default value.

GPIO Pin

The hardware’s GPIO pin the element is connected to.

GPIO Mode

The mode used by the GPIO pin. This element includes the following interrupt modes:

  • Disabled
  • Input High Impedance: Input must always be driven, either actively or by an external pull-up resistor.
  • Input Pull Up: Input with an internal pull-up resistor. Use with devices that actively drive the signal low (e.g. button connected to ground).
  • Input Pull Down: Input with an internal pull-down resistor. Use with devices that actively drive the signal high (e.g. button connected to a power rail).
  • Output Push Pull: Output actively driven high and actively driven low - must not be connected to other active outputs (e.g. LED output)
  • Output Open Drain: Output actively driven low but is high-impedance when set high. Can be connected to other open-drain/open-collector outputs. Needs an external pull-up resistor.
  • Output Open Drain Pull Up: Output actively driven low and is pulled high with an internal resistor when set high. Can be connected to other open-drain/open-collector outputs.

Initial State

The default state of the GPIO pin: high or low.

Enable Interrupt

The state of the interrupt pin: enabled or disabled.

Interrupt Mode

The mode used by the interrupt pin. This element includes the following interrupt modes:

  • None
  • Rising Edge: Event driven when a signal transitions from low to high.
  • Falling Edge: Event driven when a signal transitions from high to low.
  • Both Edges: Event driven when a signal transitions from either high or low.
  • Logic Zero: Event driven when a signal is steady at logical zero
  • Logic One: Event driven when a signal is steady at logical one

Triggers

The following triggers are available to execute events from within the GPIO pin element:

Triggered

Execute an event when the source element connected to the GPIO pin triggers.

Read

Execute an event when the GPIO pin’s value is read.

Toggled

Execute an event when the GPIO pin’s state is toggled.

Interrupted

Execute an event when the GPIO pin is interrupted.

Abilities

The following abilities are available for the GPIO pin element when its source element triggers:

Trigger

Trigger the element(s) that follow the GPIO pin element.

Set State

Set the state of the GPIO pin: high or low.

Set Pin High

Set the state of the GPIO pin to high.

Set Pin Low

Set the state of the GPIO pin to low.

Read

Read the value of the GPIO pin.

Toggle

Toggle the state of the GPIO pin.

Interrupt

Interrupt the GPIO pin.