103 return ErrorCode::OK;
提供一个通用的回调包装,支持动态参数传递。 Provides a generic callback wrapper, supporting dynamic argument passing.
通用输入输出(GPIO)接口类。General Purpose Input/Output (GPIO) interface class.
Callback callback_
GPIO 事件的回调函数。Callback function for GPIO events.
virtual bool Read()=0
读取 GPIO 引脚状态。Reads the GPIO pin state.
virtual ErrorCode SetConfig(Configuration config)=0
配置 GPIO 引脚参数。Configures the GPIO pin settings.
virtual ErrorCode Write(bool value)=0
写入 GPIO 引脚状态。Writes the GPIO pin state.
ErrorCode RegisterCallback(Callback<> callback)
注册 GPIO 事件回调函数。Registers a callback function for GPIO events.
virtual ErrorCode EnableInterrupt()=0
使能 GPIO 引脚中断。Enables the GPIO pin interrupt.
virtual ErrorCode DisableInterrupt()=0
禁用 GPIO 引脚中断。Disables the GPIO pin interrupt.
Direction
定义 GPIO 引脚的方向类型。Defines the direction types for GPIO pins.
@ OUTPUT_PUSH_PULL
推挽输出模式。Push-pull output mode.
@ RISING_INTERRUPT
上升沿中断模式。Rising edge interrupt mode.
@ FALL_RISING_INTERRUPT
双沿触发中断模式。Both edge interrupt mode.
@ OUTPUT_OPEN_DRAIN
开漏输出模式。Open-drain output mode.
@ FALL_INTERRUPT
下降沿中断模式。Falling edge interrupt mode.
GPIO()
默认构造函数。Default constructor.
Pull
定义 GPIO 引脚的上拉/下拉模式。Defines the pull-up/pull-down configurations for GPIO pins.
@ NONE
无上拉或下拉。No pull-up or pull-down.
@ DOWN
下拉模式。Pull-down mode.
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值
存储 GPIO 配置参数的结构体。Structure storing GPIO configuration parameters.
Pull pull
GPIO 上拉/下拉配置。GPIO pull-up/pull-down configuration.
Direction direction
GPIO 引脚方向。GPIO pin direction.