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.

[参考译文] Linux/TCA6424A:配置扩展器 IO 的 GPIO 以及来自器件树的 GPIO。

Guru**** 2540610 points
Other Parts Discussed in Thread: TCA6424, TCA6424A

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/611438/linux-tca6424a-configuration-gpios-of-an-expander-io-and-from-device-tree

器件型号:TCA6424A
主题中讨论的其他器件:TCA6424

工具/软件:Linux

大家好、

我在 Raspberry PI 3B 上使用的是扩展器 IO:TI 的 tca6424、它工作正常。 我正在使用此设备树 DTS 文件:

/DTS-v1/;
/插件/;
/{
兼容="BRCM、BCM2835"、"BRCM、bcm2708"、"BRCM、bcm2709";

片段@0{
目标=<&i2c1>;
_overlay__{
状态="正常";
};
};

碎片@1{
Target =<&GPIO>;
_overlay__{
tca6424a_pins:tca6424a_pins{
BRCM、引脚=<18>;
BRCM、函数=<0>;
};
};
};dmesg

碎片@2{
目标=<&i2c1>;
_overlay__{
#address-cells =<1>;
#size-cells =<0>;

tca6424@22{
兼容="ti、tca6424";
reg =<0x22>;
pinctrl-names ="default";
pinctrl-0 =<&T 6424a_PINs>;
interrupt-parent =<&GPIO>;
中断=<18 2>;//IRQ_TYPE_EDGE_FALLING
RESET-GPIO =<&GPIO 23 0>;//GPIO_ACTIVE_HIGH
};
};
};
};

我想配置该文件的输入和输出、而不是对输入进行配置:

Echo 488 >/sys/class/gpio/export
echo "in">/sys/class/gpio/gpio488/direction
CAT /sys/class/gpio/gpio488/value

或者、对于输出:

Echo 488 >/sys/class/gpio/export
echo "out">/sys/class/gpio/gpio488/direction
Echo 1 >/sys/class/gpio/gpio488/value


我该怎么做?

此致。