GPIO
Introduction to the functions and usage of GPIO.
Module Introduction
GPIO is the controller that manages the gpio module.
Function Introduction
The Linux gpio subsystem driver framework mainly consists of three parts:
- GPIO controller driver: Interacts with the GPIO controller, initializes and operates the controller
- gpio lib driver: Provides standard APIs for other modules, such as setting GPIO direction, reading and writing GPIO level state
- GPIO character device driver: Reports GPIO as character devices to user space, user space can access GPIO through standard file interfaces
Source Code Structure Introduction
The controller driver code is under the drivers/gpio directory:
|-- gpio-k1x.c
Key Features
Feature | Description |
---|---|
Supports direction setting | Supports setting GPIO as input or output |
Supports output high/low level setting | Supports setting GPIO level in output mode |
Supports gpio interrupt function | Supports rising and falling edge triggered gpio interrupts |