GPIO Read Pin Block Description
This block enables reading the status of a GPIO pin in STM microcontrollers.

Table of Contents
Inputs
This block has no inputs.
Outputs
| Output Name | Type | Description |
|---|---|---|
| Pin state | bool | Conditional output Output ports returning the states of the GPIO pins. The specific port these outputs belong to is defined by the Port parameter. The total number of outputs and their designated indices are specified by the Pin number parameter. |
Block Parameters
| Parameter | Description |
|---|---|
| Port | GPIO port identifier letter, e.g., 'A', 'B', 'C', etc. |
| Pin number | GPIO pin index numbers, e.g., a value of [0 1 3] defines three separate output ports corresponding to pins 0, 1, and 3. The values must be wrapped in square brackets and separated by spaces. |
| Sample time | The refresh execution period of the function. |

CubeMX Configuration for a Given MCU Model
H7
| No. | Name | Path | Setting | Description | Screenshot |
|---|---|---|---|---|---|
| 1 | GPIO PIN as GPIO_Input | Pinout & Configuration > Pinout view > Right-click the selected pin > GPIO_Input | GPIO_Input | Selects the operational GPIO pin to be utilized as an input. The pin must be explicitly configured as GPIO_Input. | ![]() |
See Also
Last updated on
