This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] DRA821U-Q1:通过 Linux 命令访问 GPIO 引脚

Guru**** 2465890 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1471608/dra821u-q1-gpios-pin-access-via-linux-command

器件型号:DRA821U-Q1

工具与软件:

在 Linux 控制台中:

root@j7200-evm:~#  gpiodetect
gpiochip0  [1-0021] (8条线)
gpiochip1  [1-0020] (16行)
gpiochip2  [1-0022] (24线)
gpiochip3  [2-0020] (8行)
gpiochip4  [4211000.GPIO] (85行)
gpiochip5  [6000.GPIO] (69条线)
gpiochip6  [0-0048] (11行)
gpiochip7  [0-004C] (11行)

产品说明书选项中  

主域 GPIO:GPIO0_0至 GPIO0_68

WKUP 域 GPIO:WKUP_GPIO0_0至 WKUP_GPIO0_84

RefManual 提到:  

GPIO 组:

WKUP_GPIO0

WKUP_GPIO1

GPIO0

GPIO2

GPIO4

GPIO6

问:如何知道 GPIO 引脚属于哪个 gpiochip 和行号? 例如、我想设置 WKUP_GPIO0_11输出并将其设置为0或1、我应该如何使用 Linux 命令进行测试?  

您是否有文档 描述 gpiochip 编号、行号、GPIO 域、GPIO 组和 GPIO 编号之间的关系?

谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Max:

    https://developer.technexion.com/docs/using-gpio-from-a-linux-shell

    以上文档介绍了如何访问各个引脚。 请尝试并告诉我。 这是通用的 Linux GPIO 文档。

    -基尔西

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好,我跟着链接,尝试了命令。 其中大多数看起来不错、但存在一些问题:

    WKUP_GPIO0_77:

    那么、gpioset -c0 77=1

    gpioget -c0 77、其读数为低电平。

    WKUP_GPIO0_78也是如此

    似乎这些引脚没有响应命令...

    是否有命令设置行首先输出或输入、然后使用 gpioset 或 gpioget 命令?

    谢谢

    最大值

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    最大值、

    您需要检查相应引脚多路复用寄存器的状态。  

    对于 GPIO、模式位(也称为 bits0:3)应设置为0x7、而位18需要设置。  

    此致、

    基尔西