update class driver info,support class driver export

This commit is contained in:
jzlv
2022-03-23 17:15:57 +08:00
parent c44a26d69f
commit 563888ec14
10 changed files with 108 additions and 61 deletions

View File

@@ -1,6 +1,5 @@
/**
* @file usbh_core.h
* @brief
*
* Copyright (c) 2022 sakumisu
*
@@ -47,8 +46,15 @@ extern "C" {
#define ROOTHUB(hport) true
#endif
#define USB_CLASS_MATCH_VENDOR 0x0001
#define USB_CLASS_MATCH_PRODUCT 0x0002
#define USB_CLASS_MATCH_INTF_CLASS 0x0004
#define USB_CLASS_MATCH_INTF_SUBCLASS 0x0008
#define USB_CLASS_MATCH_INTF_PROTOCOL 0x0010
#define CLASS_CONNECT(hport, i) ((hport)->config.intf[i].class_driver->connect(hport, i))
#define CLASS_DISCONNECT(hport, i) ((hport)->config.intf[i].class_driver->disconnect(hport, i))
#define CLASS_INFO_DEFINE __attribute__((section("usbh_class_info"))) __USED __ALIGNED(1)
enum usbh_event_type {
USBH_EVENT_CONNECTED = (1 << 0),
@@ -56,7 +62,7 @@ enum usbh_event_type {
};
struct usbh_class_info {
uint8_t match_flags;
uint8_t match_flags;/* Used for product specific matches; range is inclusive */
uint8_t class; /* Base device class code */
uint8_t subclass; /* Sub-class, depends on base class. Eg. */
uint8_t protocol; /* Protocol, depends on base class. Eg. */