EXTIO Unit
支持以下产品:
class EXTIOUnit
Constructors
Methods
- EXTIOUnit.set_port_mode(mode) None
设置整个端口的模式。
- 参数:
mode (Literal[0x00,0x01]) – 要设置的模式,可以是 PCA9554.IN(输入,0x00)或 PCA9554.OUT(输出,0x01)。
UIFLOW2:

- EXTIOUnit.set_pin_mode(id, mode) None
设置指定引脚的模式。
- 参数:
id (int) – 引脚编号(0-7)。
mode (Literal[0x00,0x01]) – 要设置的模式,可以是 PCA9554.IN(输入,0x00)或 PCA9554.OUT(输出,0x01)。
UIFLOW2:

class Pin
Constructors
- class Pin(port, id, mode, value)
使用指定参数初始化 Pin 对象。
- 参数:
port – 控制该引脚的端口对象。
id – 引脚标识符(例如 GPIO 编号)。
mode (int) – 引脚的模式,可以是 Pin.IN`(默认)或 `Pin.OUT。
value – 引脚的可选初始值,0 或 1。
UIFLOW2:

Methods
- Pin.init(mode, value)
使用新的模式或值重新初始化引脚。
- 参数:
mode (int) – 引脚的新模式:Pin.IN`(默认)或 `Pin.OUT。
value – 引脚的新值,0 或 1。
- Pin.value(args)
获取或设置引脚的数字值。
如果未传入参数,该方法将返回引脚的当前值。如果传入一个参数,则将引脚设置为指定值。
- 参数:
args – 用于设置引脚值的可选参数。
- Pin.on()
将引脚设置为高电平状态 (1)。
- Pin.off()
将引脚设置为低电平状态(0)。




