Difference between revisions of "Overview of GPIO pins"

[quality revision] [quality revision]
m
 
 

Template:ArticleMainWriter Template:ArticleApprovedVersion


SUMMARY
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.

1 Purpose[edit]

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.

2 System overview[edit]

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.


3 Trainings[edit]

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

4 References[edit]

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

{{ArticleMainWriter | AlexandreT}}
{{ ArticleApprovedVersion| AlexandreT | LoicP (Passed), ErwanLR (Done), GeraldB (Passed 6Aug'18), BernardP (6June'18, PASS), FabriceG (27June'18, PASS) | No previous approved version | AnneJ - 24Oct'18 - 9416 | 26Oct'18 }} 

[[Category:IOs pin management|1]]</noinclude>


'''SUMMARY'''<br>
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<sup>&reg;</sup> kernel. This is the purpose of this article.

==Purpose==
This article introduces the Linux<sup>&reg;</sup> 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==

[[File: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: '''<big>pinctrl</big>''' and '''<big>GPIOLib</big>'''. 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<ref>[http://bootlin.com/doc/training/linux-kernel/linux-kernel-slides.pdf Interrupt Management training document], ''Linux Kernel and Driver Development''</ref> offers an API allowing the configuration of this interrupt.

{{ReviewsComments| FGA W826: Suggestion for future improvement: Make above overview figure click-able with links to these overviews & GPIO internal peripheral}}

==Trainings==
Bootlin proposes a detailed presentation of those frameworks: [http://bootlin.com/doc/training/linux-kernel/linux-kernel-slides.pdf character device interface], ''Linux Kernel and Driver Development'' training document, see ''Introduction to pin muxing'' chapter.

==References==<references />

<noinclude>

[[Category:IOs pin management|1]]
{{PublicationRequestId | 9416 | 2018-10-24 | AnneJ}}</noinclude>
Line 1: Line 1:
<noinclude>
 
{{ArticleMainWriter | AlexandreT}}
 
{{ ArticleApprovedVersion| AlexandreT | LoicP (Passed), ErwanLR (Done), GeraldB (Passed 6Aug'18), BernardP (6June'18, PASS), FabriceG (27June'18, PASS) | No previous approved version | AnneJ - 24Oct'18 - 9416 | 26Oct'18 }}
 
 
[[Category:IOs pin management|1]]
 
</noinclude>
 
 
'''SUMMARY'''<br>
 
 
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<sup>&reg;</sup> kernel. This is the purpose of this article.
 
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<sup>&reg;</sup> kernel. This is the purpose of this article.
   
Line 37: Line 29:
 
==References==
 
==References==
 
<references />
 
<references />
  +
  +
<noinclude>
  +
[[Category:IOs pin management|1]]
  +
{{PublicationRequestId | 9416 | 2018-10-24 | AnneJ}}
  +
</noinclude>