This repository was archived by the owner on Sep 13, 2022. It is now read-only.

Description
Describe the bug
GPIO BCM 14 and 15 only have the UARTTXD / UARTRXD capabilities, even when the UART is disabled with enable_uart=0 in config.txt. This prevents use as regular GPIO pins.
To Reproduce
- Disable the UART on pins BCM14/15 in
config.txt with enable_uart=0.
- Attempt to set Pin Mode to Input or Output using
Pi.GPIO[14].PinMode = GpioPinDriveMode.Input
- Receive
System.NotSupportedException: Pin 14 'BCM 14 (TXD)' does not support mode 'Input'. Pin capabilities are limited to: UARTTXD
- Using the
gpio(1) command-line tool on the Pi, run gpio -g mode 14 in to set the pin mode to input
- Verify signals can be read using
gpio readall
Expected behavior
When the UART is not using pins BCM14/15, it should be possible to use these as general purpose I/O pins.
I'm very happy to submit a PR to just add the GP capability to those pins, but I wasn't sure if you wanted to do some runtime detection of whether the UART is enabled before allowing it (i.e. only report that capability if the UART is not enabled), or whether it's acceptable to always report the capability, because the underlying hardware possesses it.
Environment:
- OS: Raspbian GNU/Linux 10 (buster)
- .NET 5.0
- Unosquare.WiringPi 0.5.1
- Unosquare.Raspberry.IO 0.27.1
- Raspberry Pi 3