Built-in search
Google search
Zephyr Project
v: latest
Document Release Versions
latest
3.7.0 (LTS)
3.6.0
2.7.6 (LTS)
Downloads
PDF
zephyrproject.org Links
Project Home
SDK
Releases
Introduction
Developing with Zephyr
Kernel
OS Services
Build and Configuration Systems
Connectivity
Hardware Support
Architecture-related Guides
Barriers API
Cache Interface
Zephyr’s device emulators/simulators
External Bus and Bus Connected Peripherals Emulators
Peripherals
1-Wire Bus
Analog-to-Digital Converter (ADC)
Auxiliary Display (auxdisplay)
Audio
Battery Backed RAM (BBRAM)
BC1.2 Devices (Experimental)
Clock Control
Controller Area Network (CAN)
Chargers
Comparator
Coredump Device
Counter
Digital-to-Analog Converter (DAC)
Direct Memory Access (DMA)
Display Interface
Electrically Erasable Programmable Read-Only Memory (EEPROM)
Enhanced Serial Peripheral Interface (eSPI) Bus
Entropy
Error Detection And Correction (EDAC)
Flash
Fuel Gauge
GNSS (Global Navigation Satellite System)
General-Purpose Input/Output (GPIO)
Overview
Configuration Options
API Reference
Haptics
Hardware Information
I2C EEPROM Target
Improved Inter-Integrated Circuit (I3C) Bus
Inter-Integrated Circuit (I2C) Bus
Inter-Processor Mailbox (IPM)
Keyboard Scan
Light-Emitting Diode (LED)
Management Data Input/Output (MDIO)
MIPI Display Bus Interface (DBI)
MIPI Display Serial Interface (DSI)
Multi-bit SPI Bus
Multi-Channel Inter-Processor Mailbox (MBOX)
Peripheral Component Interconnect express Bus (PCIe)
Platform Environment Control Interface (PECI)
PS/2
Pulse Width Modulation (PWM)
Real-Time Clock (RTC)
Regulators
Reset Controller
Retained Memory
Secure Digital High Capacity (SDHC)
Sensors
Serial Peripheral Interface (SPI) Bus
Steppers
System Management Bus (SMBus)
Universal Asynchronous Receiver-Transmitter (UART)
USB-C VBUS
USB Type-C Port Controller (TCPC)
Time-aware General-Purpose Input/Output (TGPIO)
Video
Watchdog
Pin Control
Porting
Contributing to Zephyr
Project and Governance
Security
Safety
Samples and Demos
Supported Boards and Shields
Shields
Releases
Reference
API
Kconfig Options
Devicetree Bindings
West Projects
Zephyr Project
Docs / Latest
»
Hardware Support
»
Peripherals
»
General-Purpose Input/Output (GPIO)
Open on GitHub
Report an issue with this page
General-Purpose Input/Output (GPIO)
Overview
Configuration Options
Related configuration options:
CONFIG_GPIO
API Reference
GPIO
Driver
APIs
Related code samples
Basic thread manipulation
Spawn multiple threads that blink LEDs and print information to the console.
Blinky
Blink an LED forever using the GPIO API.
Button
Handle GPIO inputs with interrupts.
GPIO as a wake-up pin source
Use a GPIO as a wake-up pin source.
GPIO with custom Devicetree binding
Use custom Devicetree binding to control a GPIO.
HD44780 LCD controller
Control an HD44780-based LCD display using GPIO pins.
X-NUCLEO-53L0A1 shield
Interact with the 7-segment display and VL53L0X ranging sensor of an X-NUCLEO-53L0A1 shield.