Main Content

Digital Port Write

Set GPIO pin status

Since R2021b

Add-On Required: This feature requires the Embedded Coder Support Package for STMicroelectronics STM32 Processors add-on.

  • Digital Port Write block

Libraries:
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32F3xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32F4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32F7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32G4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32H7xx Based Boards (Dual-core)
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32H7xx Based Boards (Single-core)
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32L4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32L5xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32U5xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors / STM32WBxx Based Boards

Description

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

Ports

Input

expand all

The input port to set the GPIO pin status in incremental order.

  • 0 - the respective pin is set to low value.

  • Non zero - the pin is active low or active high.

Dependencies

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

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated | bus

Output

expand all

he simulation-only message output port, when connected to an Digital IO Interface (SoC Blockset) block, acts as pass-through with the output emitted on the output of the Digital IO Interface 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, select the Enable simulation port parameter.

Data Types: SoCData

Parameters

expand all

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

Specify the GPIO digital pin to set the logical status.

Select this parameter to read multiple port pin values.

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

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2021b