2.19. GPIO
Hier geht es um die Programmierung der GPIO's
Inhalt dieser Seite
2.19.1. Overview
2.19.2. Function Select
2.19.3. Interrupts
2.19.4. Pads
2.19.5. Software Examples
2.19.6. List of Registers
Overview
Der RP2040 hat 36 multifunktionale General Purpose Input / Output (GPIO) Pins, aufgeteilt in zwei Bänke.
Davon stehen 30 als User-Bank GPIO0 - GPIO29 zur allgemeinen Verwendung zur Verfügung. Die übrigen 6 bilden die QSPI Schnittstelle zur Ansteuerung von externen Speichern.
Alle GPIOs unterstützen digitale Ein- und Ausgänge, aber GPIO26 bis GPIO29 können auch als Eingänge für den Analog-Digital-Wandler (ADC) des Chips verwendet werden.
Jeder GPIO kann direkt von der auf den Prozessoren laufenden Software oder von einer Reihe anderer Funktionsblöcke gesteuert werden.
Die Benutzer-GPIO-Bank unterstützt die folgenden Funktionen:
- Software control via SIO (Single-Cycle IO) - Section 2.3.1.2, “GPIO Control”
- Programmable IO (PIO) - Chapter 3, PIO
- 2 × SPI - Section 4.4, “SPI”
- 2 × UART - Section 4.2, “UART”
- 2 × I2C (two-wire serial interface) - Section 4.3, “I2C”
- 8 × two-channel PWM - Section 4.5, “PWM”
- 2 × external clock inputs - Section 2.15.2.3, “External Clocks”
- 4 × general purpose clock output - Section 2.15, “Clocks”
- 4 × input to ADC - Section 4.9, “ADC and Temperature Sensor”
- USB VBUS management - Section 4.1.2.8, “VBUS Control”
- External interrupt requests, level or edge-sensitive
Die QSPI Bank unterstützt die folgenden Funktionen:
- Software control via SIO (Single-Cycle IO) - Section 2.3.1.2, “GPIO Control”
- Flash execute in place (XIP) - Section 2.6.3, “Flash”
Function Select
Die jedem GPIO zugewiesene Funktion wird durch Schreiben in das FUNCSEL-Feld im CTRL-Register des GPIO ausgewählt.
Siehe GPIO0_CTRL als Beispiel.
Die für jeden IO verfügbaren Funktionen sind in Tabelle 279 und Tabelle 281 aufgeführt.
GPIO | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | SPI0 | RX | UART0 | TX | I2C0 | SDA | PWM0 | A | SIO | PIO0 | PIO1 | USB | OVCUR | DET |
1 SPI0 CSn UART0 RX I2C0 SCL PWM0 B SIO PIO0 PIO1 USB VBUS DET | ||||||||||||||
2 SPI0 SCK UART0 CTS I2C1 SDA PWM1 A SIO PIO0 PIO1 USB VBUS EN | ||||||||||||||
3 SPI0 TX UART0 RTS I2C1 SCL PWM1 B SIO PIO0 PIO1 USB OVCUR DET | ||||||||||||||
4 SPI0 RX UART1 TX I2C0 SDA PWM2 A SIO PIO0 PIO1 USB VBUS DET | ||||||||||||||
5 SPI0 CSn UART1 RX I2C0 SCL PWM2 B SIO PIO0 PIO1 USB VBUS EN | ||||||||||||||
6 SPI0 SCK UART1 CTS I2C1 SDA PWM3 A SIO PIO0 PIO1 USB OVCUR DET | ||||||||||||||
7 SPI0 TX UART1 RTS I2C1 SCL PWM3 B SIO PIO0 PIO1 USB VBUS DET |
Interrupts
Pads
Software Examples
List of Registers
zurück zu The_Core_-_RP2040
zurück zu Raspberry_Pi_Pico_-_RP2040
zurück zu Microcontroller
Zurück zur Hauptseite