嵌入式 - GPIO的输入输出

GPIO输出模式下可以仍然具有输入功能,但输入模式下只能是输入
芯片的GPIO的工作模式,可以设置为输入或输出,一般只设置一种,要么输入要么输出。
在输出模式下,输出电路工作,根据Output Register的数值,驱动端子输出高低电平。但这个时候,并不是说输入电路的input path就是不可用的。也就是说,仍然可以读取Input Register的值,获得端子的实际电平。
在输入模式下,输出电路就需要关闭了,不然读取的状态就会受到影响。
在包括 i.MX93 芯片在内的许多系统中,配置为输出的 GPIO 引脚仍有可能允许读取其输入状态,这取决于硬件配置。这就是所谓的回读输出状态,也是许多 GPIO 实现的通用功能。
On many systems, including the i.MX93 chip, it is possible for a GPIO pin configured as an output to still allow its input state to be read, depending on the hardware configuration. This is known as reading back the output state, and it is a common feature of many GPIO implementations.
GPIO Pin as Output with Readback Capability
当 GPIO 引脚被配置为输出时,它会向外部元件驱动高电平或低电平信号。不过,在某些微控制器和处理器(包括 i.MX93)中,该引脚上的输入缓冲器仍然可以启用,从而允许系统读取该引脚从外部驱动的值。
这种功能在某些情况下非常有用,例如:
* 确认输出状态: 读取 GPIO 引脚的值,确认要驱动的信号确实存在。
* 外部电路反馈: 当外部电路可能覆盖处理器驱动的信号(如开漏配置)时,读取引脚可以检测信号是否被成功应用。
When a GPIO pin is configured as an output, it drives a high or low signal to external components. However, in some microcontrollers and processors (including the i.MX93), the input buffer can still be enabled on that pin, allowing the system to read the value that the pin is driving externally.
This capability is useful in certain situations, such as:
* Confirming the output state: Reading the value of the GPIO pin to confirm that the signal you intended to drive is indeed present.
* External Circuitry Feedback: When external circuitry might override the signal driven by t
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值