6#include DEF2STR(LIBXR_CH32_CONFIG_FILE)
43uint32_t CH32GetGPIOPeriph(GPIO_TypeDef* port);
48 CH32GPIO(GPIO_TypeDef* port, uint16_t pin,
54 ErrorCode
Write(
bool value)
override;
64 static void CheckInterrupt(uint32_t line);
66 static inline CH32GPIO* map[16] = {
nullptr};
73 void ConfigureEXTI(EXTITrigger_TypeDef trigger);
75 static uint8_t GetEXTIID(uint16_t pin);
ErrorCode SetConfig(Configuration config) override
配置 GPIO 引脚参数。Configures the GPIO pin settings.
ErrorCode DisableInterrupt() override
禁用 GPIO 引脚中断。Disables the GPIO pin interrupt.
bool Read() override
读取 GPIO 引脚状态。Reads the GPIO pin state.
ErrorCode Write(bool value) override
写入 GPIO 引脚状态。Writes the GPIO pin state.
ErrorCode EnableInterrupt() override
使能 GPIO 引脚中断。Enables the GPIO pin interrupt.
通用输入输出(GPIO)接口类。General Purpose Input/Output (GPIO) interface class.
Direction
定义 GPIO 引脚的方向类型。Defines the direction types for GPIO pins.
@ OUTPUT_PUSH_PULL
推挽输出模式。Push-pull output mode.
Pull
定义 GPIO 引脚的上拉/下拉模式。Defines the pull-up/pull-down configurations for GPIO pins.
@ NONE
无上拉或下拉。No pull-up or pull-down.
存储 GPIO 配置参数的结构体。Structure storing GPIO configuration parameters.