feat(usb): 添加USB CDC功能模块支持
- 在CMakeLists.txt中添加usb_cdc_module、usb_cdc_test_module和 usb_device_module源文件 - 添加usb_cdc_rx_event、usb_cdc_tx_event、usb_device_state_event、 usb_function_ready_event和usb_prepare_event事件定义 - 实现USB CDC串口通信功能,包括接收和发送数据处理 - 添加USB设备状态管理,支持连接、断开、激活等状态变化 - 配置设备树中的USB端点数量以支持CDC ACM功能 - 创建USB设备模块用于管理USB堆栈初始化和状态监控 - 添加USB功能就绪事件以协调不同USB功能的准备状态
This commit is contained in:
26
inc/usb_device_module.h
Normal file
26
inc/usb_device_module.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef BLINKY_USB_DEVICE_MODULE_H_
|
||||
#define BLINKY_USB_DEVICE_MODULE_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum usb_function {
|
||||
USB_FUNCTION_HID = 0x01,
|
||||
USB_FUNCTION_CDC_ACM = 0x02,
|
||||
};
|
||||
|
||||
enum usb_device_state {
|
||||
USB_DEVICE_STATE_DISCONNECTED,
|
||||
USB_DEVICE_STATE_POWERED,
|
||||
USB_DEVICE_STATE_ACTIVE,
|
||||
USB_DEVICE_STATE_SUSPENDED,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* BLINKY_USB_DEVICE_MODULE_H_ */
|
||||
Reference in New Issue
Block a user