From 6ec02659b4f36cb641814f4e718ebb4269f36738 Mon Sep 17 00:00:00 2001 From: Tang Zaozao Date: Fri, 14 Aug 2026 15:46:56 +0800 Subject: [PATCH] docs: add GPIO pin selection guidelines for Radxa ZERO Add a new page under zero/zero/app-development with guidelines for selecting GPIO pins, addressing issue #503. Content covers: - Pins shared with other hardware functions (SPI/I2C/PWM) cannot be GPIO - ADC pins (15, 26) cannot be used as GPIO output - Avoid debug console pins (8, 10) - Avoid hardware-revision-dependent pins (35, 38) - Avoid open-drain pins (22, 36) Bilingual zh/en versions included. --- .../app-development/gpio-pin-selection.md | 19 +++++++++++++++++++ .../app-development/gpio-pin-selection.md | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 docs/zero/zero/app-development/gpio-pin-selection.md create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/zero/zero/app-development/gpio-pin-selection.md diff --git a/docs/zero/zero/app-development/gpio-pin-selection.md b/docs/zero/zero/app-development/gpio-pin-selection.md new file mode 100644 index 000000000..02c5ba7e7 --- /dev/null +++ b/docs/zero/zero/app-development/gpio-pin-selection.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 3 +--- + +# GPIO 引脚选择指南 + +以 Radxa ZERO 为例,当你需要选择一个 GPIO 引脚时,以下几点值得考虑: + +1. 如果你计划将某个引脚用作其他硬件功能(如 SPI / I2C / PWM 等),那么它**不能**再作为 GPIO 使用。 +2. 一般来说,ADC 引脚**不能**用作 GPIO(引脚 15 和 26)。至少不能作为输出来使用。 +3. 尽量避免使用引脚 8 和 10,它们是默认的调试串口,许多软件部分都假设它们可用。 +4. 尽量避免使用仅在特定硬件版本上才可用的引脚(引脚 35 和 38),以便在采购时有更多灵活性。 +5. 尽量避免使用开漏(OD)引脚(引脚 22 和 36),因为它们需要额外的电路才能像普通 GPIO 一样工作。 + +以上指南在拥有足够开发资源的情况下几乎都可以被打破,并且它们按照所需工作量从多到少排序。但如果你已经因为 GPIO 数量不足而考虑违背第 4 条,那么你或许应该考虑加入一个 I2C/SPI GPIO 扩展芯片,省去这些麻烦。 + +:::info +本页以 Radxa ZERO 为例。其他产品的具体引脚功能请以对应产品的 [硬件接口说明](../hardware-design/hardware-interface) 为准。 +::: diff --git a/i18n/en/docusaurus-plugin-content-docs/current/zero/zero/app-development/gpio-pin-selection.md b/i18n/en/docusaurus-plugin-content-docs/current/zero/zero/app-development/gpio-pin-selection.md new file mode 100644 index 000000000..c805f4a44 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/zero/zero/app-development/gpio-pin-selection.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 3 +--- + +# GPIO Pin Selection Guidelines + +Taking Radxa ZERO as an example, here are some things to consider when you need to pick a GPIO pin: + +1. If you plan to use a pin as another hardware feature (i.e. SPI/I2C/PWM/etc), then it CANNOT be used as GPIO. +2. Generally, ADC pins CANNOT be used as GPIO (pin 15 & 26). Not the output at least. +3. Avoid pin 8 & 10, since they are the default debug console, and many software parts assume they are available. +4. Avoid pins that are only available on a specific hardware revision (pin 35 & 38) to allow more sourcing flexibility. +5. Avoid OD pins (pin 22 & 36) since they require additional circuit to function like a normal GPIO. + +Now almost every guideline above can be violated given enough development resources, and they are ordered by the effort required from the most to the least. But if you are already considering to go against #4 due to the lack of available GPIOs, you might want to include an I2C/SPI GPIO expander and save the headache. + +:::info +This page takes Radxa ZERO as an example. For other products, please refer to the pin functions listed in the corresponding [hardware interface](../hardware-design/hardware-interface) page. +:::