Overview of GPIO pins

来自百问网嵌入式Linux wiki
Zhouyuebiao讨论 | 贡献2020年5月7日 (四) 23:53的版本 (创建页面,内容为“Each STM32 ball/pin is multiplexed in order to support multiple functions. For example, an STM32 pin can operate in three different modes: GPIO, alternate functions…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Each STM32 ball/pin is multiplexed in order to support multiple functions. For example, an STM32 pin can operate in three different modes: GPIO, alternate functions or analog. All pin settings are performed via the GPIO internal peripheral, which can be configured through Linux® kernel. This is the purpose of this article.

Purpose

This article introduces the Linux® kernel frameworks dedicated to pin configuration and control. Its purpose is to provide to newcomers some first insights regarding pin management frameworks. Detailed information are provided in the articles referenced in this page.

System overview

文件:Pin overview.png

ST microprocessor pin can be configured in several modes:

  • General-purpose input/output (GPIO): controlled by software
  • Alternate functions: controlled directly by a hardware block.
  • Analog: controlled directly by a hardware block.

Refer to GPIO internal peripheral for more hardware details.

Two frameworks can be used to configure and control a given pin: pinctrl and GPIOLib. They are selected according to pin usage:

  • pinctrl is used mainly when a pin is controlled by an internal peripheral. Pinctrl handles the pin configuration and allows assigning a specific feature to a pin. The Pinctrl overview article provides an overview of the pinctrl framework.
  • GPIOLib is used when a pin needs to be controlled dynamically at runtime (GPIO). GPIOLib is used to control a pin by software. The GPIOLib overview article provides an overview of the GPIOLib framework.

In addition, when a pin is used as external interrupt source, Irqchip framework[1] offers an API allowing the configuration of this interrupt.

<securetransclude src="ProtectedTemplate:ReviewsComments" params="FGA W826: Suggestion for future improvement: Make above overview figure click-able with links to these overviews & GPIO internal peripheral"></securetransclude>{{#set:Has reviews comments=true}}

Trainings

Bootlin proposes a detailed presentation of those frameworks: character device interface, Linux Kernel and Driver Development training document, see Introduction to pin muxing chapter.

References

  1. Interrupt Management training document, Linux Kernel and Driver Development

<securetransclude src="ProtectedTemplate:PublicationRequestId" params="9416 | 2018-10-24 | AnneJ"></securetransclude>