Skip to Content

GPIO Read Pin Block Description

This block enables reading the status of a GPIO pin in STM microcontrollers.



GPIO Read Pin block

Table of Contents

Inputs

This block has no inputs.

Outputs

Output NameTypeDescription
Pin stateboolConditional 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

ParameterDescription
PortGPIO port identifier letter, e.g., 'A', 'B', 'C', etc.
Pin numberGPIO 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 timeThe refresh execution period of the function.


Parameters for GPIO Read Pin block

CubeMX Configuration for a Given MCU Model

No.NamePathSettingDescriptionScreenshot
1GPIO PIN as GPIO_InputPinout & Configuration > Pinout view > Right-click the selected pin > GPIO_InputGPIO_InputSelects the operational GPIO pin to be utilized as an input. The pin must be explicitly configured as GPIO_Input.GPIO Configuration in CubeMX

See Also

Last updated on