feat(ch934x): 添加GPIO方向控制和串口参数配置功能
- 添加Ch934xMode和GpioDirection枚举类定义 - 实现GPIO方向控制相关方法(setGpioDir/queryGpioDirFromCache) - 添加GPIO使能控制(enableGpio)和数量/组数查询(getGpiocount/getGpiogroup) - 实现串口参数配置(setSerialParameter)包括波特率/数据位/停止位/校验位/流控 - 添加Break信号控制(setBreak)功能 - 实现当前串口模式查询(getCurrentMode) - 添加设备连接状态查询(isConnected)和已打开设备列表获取(getConnectedDevices) - 更新文档说明GPIO方向控制和串口参数配置用法 - 在示例应用中添加相关功能按钮和操作逻辑
This commit is contained in:
@@ -26,3 +26,30 @@ class Ch934xDeviceType {
|
||||
/// 未知或非 CH934X 设备。
|
||||
static const int unknown = -1;
|
||||
}
|
||||
|
||||
/// 串口当前模式,对应 SDK [Mode] 枚举。
|
||||
///
|
||||
/// 仅对 CH934X 型号有效(CH348 调用 [Ch934xSerial.getCurrentMode] 无意义)。
|
||||
class Ch934xMode {
|
||||
const Ch934xMode._();
|
||||
|
||||
/// 普通模式。
|
||||
static const int normal = 0;
|
||||
|
||||
/// 硬件流控模式。
|
||||
static const int hardflow = 1;
|
||||
|
||||
/// GPIO 模式。
|
||||
static const int gpio = 2;
|
||||
}
|
||||
|
||||
/// GPIO 方向,对应 SDK [GPIO_DIR] 枚举。
|
||||
class GpioDirection {
|
||||
const GpioDirection._();
|
||||
|
||||
/// 输入方向。
|
||||
static const int in_ = 0;
|
||||
|
||||
/// 输出方向。
|
||||
static const int out = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user