Main Content

Digital Port Read

Read GPIO pin status

  • Library:
  • Embedded Coder Support Package for STMicroelectronics Discovery Boards/STM32F4xx Based Boards

    Embedded Coder Support Package for STMicroelectronics Discovery Boards/STM32F7xx Based Boards

    Embedded Coder Support Package for STMicroelectronics Discovery Boards/STM32G4xx Based Boards

    Embedded Coder Support Package for STMicroelectronics Discovery Boards/STM32H7xx Based Boards

  • Digital Port Read block

Description

Read the logical status of a GPIO port pins for STM32 processors.

Ports

Input

expand all

The simulation-only message input port, when connected to an Digital IO Interface (SoC Blockset) block, acts as pass-through with the input to the Digital IO Interface block emitted on the output of the Digital Port Read block during simulation. When the Access port pins as array parameter is not selected, a simulation port is generated for each pin in the Pin number parameter, otherwise the pin array must be treated as a scalar.

Dependencies

To enable this port, check the Enable simulation port parameter.

Data Types: SoCData

Output

expand all

The port outputs the logical state of the digital pin on the board that you specify in the Pin number parameter.

Dependencies

To output multiple port values, select Access port pins as array parameter.

Data Types: Boolean

Parameters

expand all

Select one of GPIOA to GPIOK ports to get a GPIO pin status of a specified GPIO port.

Specify a GPIO pin to read the logical status.

When you specify a GPIO pin number and Access port pins as array parameter is enabled, the output is always in the incremental order of pin number.

Select this parameter to output multiple port pin values.

Specify in seconds how often this block reads the pin value.

When you specify this parameter as -1, Simulink® determines the best sample time for the block based on the block context within the model.

Select this parameter to add an SoC Blockset compatible simulation input port.

Version History

Introduced in R2021b