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

GPIO BCM14/15 do not have GP capability even when UART disabled #32

@rmc47

Description

@rmc47

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

  1. Disable the UART on pins BCM14/15 in config.txt with enable_uart=0.
  2. Attempt to set Pin Mode to Input or Output using Pi.GPIO[14].PinMode = GpioPinDriveMode.Input
  3. Receive System.NotSupportedException: Pin 14 'BCM 14 (TXD)' does not support mode 'Input'. Pin capabilities are limited to: UARTTXD
  4. Using the gpio(1) command-line tool on the Pi, run gpio -g mode 14 in to set the pin mode to input
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions