formatting

This commit is contained in:
hathach 2015-05-01 18:45:22 +07:00
parent c73907f831
commit 62ae417add
10 changed files with 86 additions and 43 deletions

View File

@ -52,7 +52,8 @@ enum {
ASCII_BACKSPACE = 8, ASCII_BACKSPACE = 8,
}; };
typedef enum { typedef enum
{
CLI_ERROR_NONE = 0, CLI_ERROR_NONE = 0,
CLI_ERROR_INVALID_PARA, CLI_ERROR_INVALID_PARA,
CLI_ERROR_INVALID_PATH, CLI_ERROR_INVALID_PATH,
@ -98,7 +99,8 @@ CLI_COMMAND_TABLE(CLI_PROTOTYPE_EXPAND)
// Expand to enum value // Expand to enum value
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
#define CLI_ENUM_EXPAND(command, function, description) CLI_CMDTYPE_##command, #define CLI_ENUM_EXPAND(command, function, description) CLI_CMDTYPE_##command,
typedef enum { typedef enum
{
CLI_COMMAND_TABLE(CLI_ENUM_EXPAND) CLI_COMMAND_TABLE(CLI_ENUM_EXPAND)
CLI_CMDTYPE_COUNT CLI_CMDTYPE_COUNT
}cli_cmdtype_t; }cli_cmdtype_t;

View File

@ -55,7 +55,8 @@
/// CDC Pipe ID, used to indicate which pipe the API is addressing to (Notification, Out, In) /// CDC Pipe ID, used to indicate which pipe the API is addressing to (Notification, Out, In)
typedef enum { typedef enum
{
CDC_PIPE_NOTIFICATION , ///< Notification pipe CDC_PIPE_NOTIFICATION , ///< Notification pipe
CDC_PIPE_DATA_IN , ///< Data in pipe CDC_PIPE_DATA_IN , ///< Data in pipe
CDC_PIPE_DATA_OUT , ///< Data out pipe CDC_PIPE_DATA_OUT , ///< Data out pipe
@ -66,7 +67,8 @@ typedef enum {
// CDC COMMUNICATION INTERFACE CLASS // CDC COMMUNICATION INTERFACE CLASS
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
/// Communication Interface Subclass Codes /// Communication Interface Subclass Codes
typedef enum { typedef enum
{
CDC_COMM_SUBCLASS_DIRECT_LINE_CONTROL_MODEL = 0x01 , ///< Direct Line Control Model [USBPSTN1.2] CDC_COMM_SUBCLASS_DIRECT_LINE_CONTROL_MODEL = 0x01 , ///< Direct Line Control Model [USBPSTN1.2]
CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL , ///< Abstract Control Model [USBPSTN1.2] CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL , ///< Abstract Control Model [USBPSTN1.2]
CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL , ///< Telephone Control Model [USBPSTN1.2] CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL , ///< Telephone Control Model [USBPSTN1.2]
@ -82,7 +84,8 @@ typedef enum {
} cdc_comm_sublcass_type_t; } cdc_comm_sublcass_type_t;
/// Communication Interface Protocol Codes /// Communication Interface Protocol Codes
typedef enum { typedef enum
{
CDC_COMM_PROTOCOL_ATCOMMAND = 0x01 , ///< AT Commands: V.250 etc CDC_COMM_PROTOCOL_ATCOMMAND = 0x01 , ///< AT Commands: V.250 etc
CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101 , ///< AT Commands defined by PCCA-101 CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101 , ///< AT Commands defined by PCCA-101
CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101_AND_ANNEXO , ///< AT Commands defined by PCCA-101 & Annex O CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101_AND_ANNEXO , ///< AT Commands defined by PCCA-101 & Annex O
@ -94,7 +97,8 @@ typedef enum {
//------------- SubType Descriptor in COMM Functional Descriptor -------------// //------------- SubType Descriptor in COMM Functional Descriptor -------------//
/// Communication Interface SubType Descriptor /// Communication Interface SubType Descriptor
typedef enum { typedef enum
{
CDC_FUNC_DESC_HEADER = 0x00 , ///< Header Functional Descriptor, which marks the beginning of the concatenated set of functional descriptors for the interface. CDC_FUNC_DESC_HEADER = 0x00 , ///< Header Functional Descriptor, which marks the beginning of the concatenated set of functional descriptors for the interface.
CDC_FUNC_DESC_CALL_MANAGEMENT = 0x01 , ///< Call Management Functional Descriptor. CDC_FUNC_DESC_CALL_MANAGEMENT = 0x01 , ///< Call Management Functional Descriptor.
CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT = 0x02 , ///< Abstract Control Management Functional Descriptor. CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT = 0x02 , ///< Abstract Control Management Functional Descriptor.
@ -148,7 +152,8 @@ typedef enum{
// MANAGEMENT ELEMENT REQUEST (CONTROL ENDPOINT) // MANAGEMENT ELEMENT REQUEST (CONTROL ENDPOINT)
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
/// Communication Interface Management Element Request Codes /// Communication Interface Management Element Request Codes
typedef enum { typedef enum
{
CDC_REQUEST_SEND_ENCAPSULATED_COMMAND = 0x00, ///< is used to issue a command in the format of the supported control protocol of the Communications Class interface CDC_REQUEST_SEND_ENCAPSULATED_COMMAND = 0x00, ///< is used to issue a command in the format of the supported control protocol of the Communications Class interface
CDC_REQUEST_GET_ENCAPSULATED_RESPONSE = 0x01, ///< is used to request a response in the format of the supported control protocol of the Communications Class interface. CDC_REQUEST_GET_ENCAPSULATED_RESPONSE = 0x01, ///< is used to request a response in the format of the supported control protocol of the Communications Class interface.
@ -198,7 +203,8 @@ typedef enum {
// MANAGEMENT ELEMENENT NOTIFICATION (NOTIFICATION ENDPOINT) // MANAGEMENT ELEMENENT NOTIFICATION (NOTIFICATION ENDPOINT)
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
/// Communication Interface Management Element Notification Codes /// Communication Interface Management Element Notification Codes
typedef enum { typedef enum
{
NETWORK_CONNECTION = 0x00, ///< This notification allows the device to notify the host about network connection status. NETWORK_CONNECTION = 0x00, ///< This notification allows the device to notify the host about network connection status.
RESPONSE_AVAILABLE = 0x01, ///< This notification allows the device to notify the hostthat a response is available. This response can be retrieved with a subsequent \ref CDC_REQUEST_GET_ENCAPSULATED_RESPONSE request. RESPONSE_AVAILABLE = 0x01, ///< This notification allows the device to notify the hostthat a response is available. This response can be retrieved with a subsequent \ref CDC_REQUEST_GET_ENCAPSULATED_RESPONSE request.

View File

@ -56,7 +56,8 @@
#endif #endif
/// RNDIS Message Types /// RNDIS Message Types
typedef enum { typedef enum
{
RNDIS_MSG_PACKET = 0x00000001UL, ///< The host and device use this to send network data to one another. RNDIS_MSG_PACKET = 0x00000001UL, ///< The host and device use this to send network data to one another.
RNDIS_MSG_INITIALIZE = 0x00000002UL, ///< Sent by the host to initialize the device. RNDIS_MSG_INITIALIZE = 0x00000002UL, ///< Sent by the host to initialize the device.
@ -80,7 +81,8 @@ typedef enum {
}rndis_msg_type_t; }rndis_msg_type_t;
/// RNDIS Message Status Values /// RNDIS Message Status Values
typedef enum { typedef enum
{
RNDIS_STATUS_SUCCESS = 0x00000000UL, ///< Success RNDIS_STATUS_SUCCESS = 0x00000000UL, ///< Success
RNDIS_STATUS_FAILURE = 0xC0000001UL, ///< Unspecified error RNDIS_STATUS_FAILURE = 0xC0000001UL, ///< Unspecified error
RNDIS_STATUS_INVALID_DATA = 0xC0010015UL, ///< Invalid data error RNDIS_STATUS_INVALID_DATA = 0xC0010015UL, ///< Invalid data error
@ -243,7 +245,8 @@ typedef struct {
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
/// NDIS Object ID /// NDIS Object ID
typedef enum { typedef enum
{
//------------- General Required OIDs -------------// //------------- General Required OIDs -------------//
RNDIS_OID_GEN_SUPPORTED_LIST = 0x00010101, ///< List of supported OIDs RNDIS_OID_GEN_SUPPORTED_LIST = 0x00010101, ///< List of supported OIDs
RNDIS_OID_GEN_HARDWARE_STATUS = 0x00010102, ///< Hardware status RNDIS_OID_GEN_HARDWARE_STATUS = 0x00010102, ///< Hardware status
@ -283,7 +286,8 @@ typedef enum {
} rndis_oid_type_t; } rndis_oid_type_t;
/// RNDIS Packet Filter Bits \ref RNDIS_OID_GEN_CURRENT_PACKET_FILTER. /// RNDIS Packet Filter Bits \ref RNDIS_OID_GEN_CURRENT_PACKET_FILTER.
typedef enum { typedef enum
{
RNDIS_PACKET_TYPE_DIRECTED = 0x00000001, ///< Directed packets. Directed packets contain a destination address equal to the station address of the NIC. RNDIS_PACKET_TYPE_DIRECTED = 0x00000001, ///< Directed packets. Directed packets contain a destination address equal to the station address of the NIC.
RNDIS_PACKET_TYPE_MULTICAST = 0x00000002, ///< Multicast address packets sent to addresses in the multicast address list. RNDIS_PACKET_TYPE_MULTICAST = 0x00000002, ///< Multicast address packets sent to addresses in the multicast address list.
RNDIS_PACKET_TYPE_ALL_MULTICAST = 0x00000004, ///< All multicast address packets, not just the ones enumerated in the multicast address list. RNDIS_PACKET_TYPE_ALL_MULTICAST = 0x00000004, ///< All multicast address packets, not just the ones enumerated in the multicast address list.

View File

@ -56,34 +56,39 @@
* @{ */ * @{ */
/// HID Subclass /// HID Subclass
typedef enum { typedef enum
{
HID_SUBCLASS_NONE = 0, ///< No Subclass HID_SUBCLASS_NONE = 0, ///< No Subclass
HID_SUBCLASS_BOOT = 1 ///< Boot Interface Subclass HID_SUBCLASS_BOOT = 1 ///< Boot Interface Subclass
}hid_subclass_type_t; }hid_subclass_type_t;
/// HID Protocol /// HID Protocol
typedef enum { typedef enum
{
HID_PROTOCOL_NONE = 0, ///< None HID_PROTOCOL_NONE = 0, ///< None
HID_PROTOCOL_KEYBOARD = 1, ///< Keyboard HID_PROTOCOL_KEYBOARD = 1, ///< Keyboard
HID_PROTOCOL_MOUSE = 2 ///< Mouse HID_PROTOCOL_MOUSE = 2 ///< Mouse
}hid_protocol_type_t; }hid_protocol_type_t;
/// HID Descriptor Type /// HID Descriptor Type
typedef enum { typedef enum
{
HID_DESC_TYPE_HID = 0x21, ///< HID Descriptor HID_DESC_TYPE_HID = 0x21, ///< HID Descriptor
HID_DESC_TYPE_REPORT = 0x22, ///< Report Descriptor HID_DESC_TYPE_REPORT = 0x22, ///< Report Descriptor
HID_DESC_TYPE_PHYSICAL = 0x23 ///< Physical Descriptor HID_DESC_TYPE_PHYSICAL = 0x23 ///< Physical Descriptor
}hid_descriptor_type_t; }hid_descriptor_type_t;
/// HID Request Report Type /// HID Request Report Type
typedef enum { typedef enum
{
HID_REQUEST_REPORT_INPUT = 1, ///< Input HID_REQUEST_REPORT_INPUT = 1, ///< Input
HID_REQUEST_REPORT_OUTPUT, ///< Output HID_REQUEST_REPORT_OUTPUT, ///< Output
HID_REQUEST_REPORT_FEATURE ///< Feature HID_REQUEST_REPORT_FEATURE ///< Feature
}hid_request_report_type_t; }hid_request_report_type_t;
/// HID Class Specific Control Request /// HID Class Specific Control Request
typedef enum { typedef enum
{
HID_REQUEST_CONTROL_GET_REPORT = 0x01, ///< Get Report HID_REQUEST_CONTROL_GET_REPORT = 0x01, ///< Get Report
HID_REQUEST_CONTROL_GET_IDLE = 0x02, ///< Get Idle HID_REQUEST_CONTROL_GET_IDLE = 0x02, ///< Get Idle
HID_REQUEST_CONTROL_GET_PROTOCOL = 0x03, ///< Get Protocol HID_REQUEST_CONTROL_GET_PROTOCOL = 0x03, ///< Get Protocol
@ -165,7 +170,8 @@ typedef struct ATTR_PACKED
} hid_mouse_report_t; } hid_mouse_report_t;
/// Standard Mouse Buttons Bitmap /// Standard Mouse Buttons Bitmap
typedef enum { typedef enum
{
MOUSE_BUTTON_LEFT = BIT_(0), ///< Left button MOUSE_BUTTON_LEFT = BIT_(0), ///< Left button
MOUSE_BUTTON_RIGHT = BIT_(1), ///< Right button MOUSE_BUTTON_RIGHT = BIT_(1), ///< Right button
MOUSE_BUTTON_MIDDLE = BIT_(2) ///< Middle button MOUSE_BUTTON_MIDDLE = BIT_(2) ///< Middle button
@ -188,7 +194,8 @@ typedef struct ATTR_PACKED
} hid_keyboard_report_t; } hid_keyboard_report_t;
/// Keyboard modifier codes bitmap /// Keyboard modifier codes bitmap
typedef enum { typedef enum
{
KEYBOARD_MODIFIER_LEFTCTRL = BIT_(0), ///< Left Control KEYBOARD_MODIFIER_LEFTCTRL = BIT_(0), ///< Left Control
KEYBOARD_MODIFIER_LEFTSHIFT = BIT_(1), ///< Left Shift KEYBOARD_MODIFIER_LEFTSHIFT = BIT_(1), ///< Left Shift
KEYBOARD_MODIFIER_LEFTALT = BIT_(2), ///< Left Alt KEYBOARD_MODIFIER_LEFTALT = BIT_(2), ///< Left Alt
@ -199,7 +206,8 @@ typedef enum {
KEYBOARD_MODIFIER_RIGHTGUI = BIT_(7) ///< Right Window KEYBOARD_MODIFIER_RIGHTGUI = BIT_(7) ///< Right Window
}hid_keyboard_modifier_bm_t; }hid_keyboard_modifier_bm_t;
typedef enum { typedef enum
{
KEYBOARD_LED_NUMLOCK = BIT_(0), ///< Num Lock LED KEYBOARD_LED_NUMLOCK = BIT_(0), ///< Num Lock LED
KEYBOARD_LED_CAPSLOCK = BIT_(1), ///< Caps Lock LED KEYBOARD_LED_CAPSLOCK = BIT_(1), ///< Caps Lock LED
KEYBOARD_LED_SCROLLLOCK = BIT_(2), ///< Scroll Lock LED KEYBOARD_LED_SCROLLLOCK = BIT_(2), ///< Scroll Lock LED

View File

@ -56,7 +56,8 @@
// Mass Storage Class Constant // Mass Storage Class Constant
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
/// MassStorage Subclass /// MassStorage Subclass
typedef enum { typedef enum
{
MSC_SUBCLASS_RBC = 1 , ///< Reduced Block Commands (RBC) T10 Project 1240-D MSC_SUBCLASS_RBC = 1 , ///< Reduced Block Commands (RBC) T10 Project 1240-D
MSC_SUBCLASS_SFF_MMC , ///< SFF-8020i, MMC-2 (ATAPI). Typically used by a CD/DVD device MSC_SUBCLASS_SFF_MMC , ///< SFF-8020i, MMC-2 (ATAPI). Typically used by a CD/DVD device
MSC_SUBCLASS_QIC , ///< QIC-157. Typically used by a tape device MSC_SUBCLASS_QIC , ///< QIC-157. Typically used by a tape device
@ -72,14 +73,16 @@ enum {
/// \brief MassStorage Protocol. /// \brief MassStorage Protocol.
/// \details CBI only approved to use with full-speed floopy disk & should not used with highspeed or device other than floopy /// \details CBI only approved to use with full-speed floopy disk & should not used with highspeed or device other than floopy
typedef enum { typedef enum
{
MSC_PROTOCOL_CBI = 0 , ///< Control/Bulk/Interrupt protocol (with command completion interrupt) MSC_PROTOCOL_CBI = 0 , ///< Control/Bulk/Interrupt protocol (with command completion interrupt)
MSC_PROTOCOL_CBI_NO_INTERRUPT = 1 , ///< Control/Bulk/Interrupt protocol (without command completion interrupt) MSC_PROTOCOL_CBI_NO_INTERRUPT = 1 , ///< Control/Bulk/Interrupt protocol (without command completion interrupt)
MSC_PROTOCOL_BOT = 0x50 ///< Bulk-Only Transport MSC_PROTOCOL_BOT = 0x50 ///< Bulk-Only Transport
}msc_protocol_type_t; }msc_protocol_type_t;
/// MassStorage Class-Specific Control Request /// MassStorage Class-Specific Control Request
typedef enum { typedef enum
{
MSC_REQUEST_GET_MAX_LUN = 254, ///< The Get Max LUN device request is used to determine the number of logical units supported by the device. Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15 MSC_REQUEST_GET_MAX_LUN = 254, ///< The Get Max LUN device request is used to determine the number of logical units supported by the device. Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15
MSC_REQUEST_RESET = 255 ///< This request is used to reset the mass storage device and its associated interface. This class-specific request shall ready the device for the next CBW from the host. MSC_REQUEST_RESET = 255 ///< This request is used to reset the mass storage device and its associated interface. This class-specific request shall ready the device for the next CBW from the host.
}msc_request_type_t; }msc_request_type_t;
@ -87,7 +90,8 @@ typedef enum {
/// \brief Command Block Status Values /// \brief Command Block Status Values
/// \details Indicates the success or failure of the command. The device shall set this byte to zero if the command completed /// \details Indicates the success or failure of the command. The device shall set this byte to zero if the command completed
/// successfully. A non-zero value shall indicate a failure during command execution according to the following /// successfully. A non-zero value shall indicate a failure during command execution according to the following
typedef enum { typedef enum
{
MSC_CSW_STATUS_PASSED = 0 , ///< MSC_CSW_STATUS_PASSED MSC_CSW_STATUS_PASSED = 0 , ///< MSC_CSW_STATUS_PASSED
MSC_CSW_STATUS_FAILED , ///< MSC_CSW_STATUS_FAILED MSC_CSW_STATUS_FAILED , ///< MSC_CSW_STATUS_FAILED
MSC_CSW_STATUS_PHASE_ERROR ///< MSC_CSW_STATUS_PHASE_ERROR MSC_CSW_STATUS_PHASE_ERROR ///< MSC_CSW_STATUS_PHASE_ERROR
@ -123,7 +127,8 @@ STATIC_ASSERT(sizeof(msc_cmd_status_wrapper_t) == 13, "size is not correct");
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
/// SCSI Command Operation Code /// SCSI Command Operation Code
typedef enum { typedef enum
{
SCSI_CMD_TEST_UNIT_READY = 0x00, ///< The SCSI Test Unit Ready command is used to determine if a device is ready to transfer data (read/write), i.e. if a disk has spun up, if a tape is loaded and ready etc. The device does not perform a self-test operation. SCSI_CMD_TEST_UNIT_READY = 0x00, ///< The SCSI Test Unit Ready command is used to determine if a device is ready to transfer data (read/write), i.e. if a disk has spun up, if a tape is loaded and ready etc. The device does not perform a self-test operation.
SCSI_CMD_INQUIRY = 0x12, ///< The SCSI Inquiry command is used to obtain basic information from a target device. SCSI_CMD_INQUIRY = 0x12, ///< The SCSI Inquiry command is used to obtain basic information from a target device.
SCSI_CMD_MODE_SELECT_6 = 0x15, ///< provides a means for the application client to specify medium, logical unit, or peripheral device parameters to the device server. Device servers that implement the MODE SELECT(6) command shall also implement the MODE SENSE(6) command. Application clients should issue MODE SENSE(6) prior to each MODE SELECT(6) to determine supported mode pages, page lengths, and other parameters. SCSI_CMD_MODE_SELECT_6 = 0x15, ///< provides a means for the application client to specify medium, logical unit, or peripheral device parameters to the device server. Device servers that implement the MODE SELECT(6) command shall also implement the MODE SENSE(6) command. Application clients should issue MODE SENSE(6) prior to each MODE SELECT(6) to determine supported mode pages, page lengths, and other parameters.
@ -137,7 +142,8 @@ typedef enum {
}scsi_cmd_type_t; }scsi_cmd_type_t;
/// SCSI Sense Key /// SCSI Sense Key
typedef enum { typedef enum
{
SCSI_SENSEKEY_NONE = 0x00, ///< no specific Sense Key. This would be the case for a successful command SCSI_SENSEKEY_NONE = 0x00, ///< no specific Sense Key. This would be the case for a successful command
SCSI_SENSEKEY_RECOVERED_ERROR = 0x01, ///< ndicates the last command completed successfully with some recovery action performed by the disc drive. SCSI_SENSEKEY_RECOVERED_ERROR = 0x01, ///< ndicates the last command completed successfully with some recovery action performed by the disc drive.
SCSI_SENSEKEY_NOT_READY = 0x02, ///< Indicates the logical unit addressed cannot be accessed. SCSI_SENSEKEY_NOT_READY = 0x02, ///< Indicates the logical unit addressed cannot be accessed.

View File

@ -94,7 +94,8 @@
/// \brief Error Code returned /// \brief Error Code returned
typedef enum { typedef enum
{
ERROR_TABLE(ERROR_ENUM) ERROR_TABLE(ERROR_ENUM)
TUSB_ERROR_COUNT TUSB_ERROR_COUNT
}tusb_error_t; }tusb_error_t;

View File

@ -48,21 +48,24 @@
#endif #endif
/// defined base on EHCI specs value for Endpoint Speed /// defined base on EHCI specs value for Endpoint Speed
typedef enum { typedef enum
{
TUSB_SPEED_FULL = 0, TUSB_SPEED_FULL = 0,
TUSB_SPEED_LOW , TUSB_SPEED_LOW ,
TUSB_SPEED_HIGH TUSB_SPEED_HIGH
}tusb_speed_t; }tusb_speed_t;
/// defined base on USB Specs Endpoint's bmAttributes /// defined base on USB Specs Endpoint's bmAttributes
typedef enum { typedef enum
{
TUSB_XFER_CONTROL = 0 , TUSB_XFER_CONTROL = 0 ,
TUSB_XFER_ISOCHRONOUS , TUSB_XFER_ISOCHRONOUS ,
TUSB_XFER_BULK , TUSB_XFER_BULK ,
TUSB_XFER_INTERRUPT TUSB_XFER_INTERRUPT
}tusb_xfer_type_t; }tusb_xfer_type_t;
typedef enum { typedef enum
{
TUSB_DIR_HOST_TO_DEV = 0, TUSB_DIR_HOST_TO_DEV = 0,
TUSB_DIR_DEV_TO_HOST = 1, TUSB_DIR_DEV_TO_HOST = 1,
@ -71,7 +74,8 @@ typedef enum {
/// USB Descriptor Types (section 9.4 table 9-5) /// USB Descriptor Types (section 9.4 table 9-5)
typedef enum { typedef enum
{
TUSB_DESC_TYPE_DEVICE = 0x01 , TUSB_DESC_TYPE_DEVICE = 0x01 ,
TUSB_DESC_TYPE_CONFIGURATION = 0x02 , TUSB_DESC_TYPE_CONFIGURATION = 0x02 ,
TUSB_DESC_TYPE_STRING = 0x03 , TUSB_DESC_TYPE_STRING = 0x03 ,
@ -86,7 +90,8 @@ typedef enum {
TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC = 0x24 TUSB_DESC_TYPE_INTERFACE_CLASS_SPECIFIC = 0x24
}tusb_std_descriptor_type_t; }tusb_std_descriptor_type_t;
typedef enum { typedef enum
{
TUSB_REQUEST_GET_STATUS =0 , ///< 0 TUSB_REQUEST_GET_STATUS =0 , ///< 0
TUSB_REQUEST_CLEAR_FEATURE , ///< 1 TUSB_REQUEST_CLEAR_FEATURE , ///< 1
TUSB_REQUEST_RESERVED , ///< 2 TUSB_REQUEST_RESERVED , ///< 2
@ -102,20 +107,23 @@ typedef enum {
TUSB_REQUEST_SYNCH_FRAME ///< 12 TUSB_REQUEST_SYNCH_FRAME ///< 12
}tusb_std_request_code_t; }tusb_std_request_code_t;
typedef enum { typedef enum
{
TUSB_REQUEST_TYPE_STANDARD = 0, TUSB_REQUEST_TYPE_STANDARD = 0,
TUSB_REQUEST_TYPE_CLASS, TUSB_REQUEST_TYPE_CLASS,
TUSB_REQUEST_TYPE_VENDOR TUSB_REQUEST_TYPE_VENDOR
} tusb_control_request_type_t; } tusb_control_request_type_t;
typedef enum { typedef enum
{
TUSB_REQUEST_RECIPIENT_DEVICE =0, TUSB_REQUEST_RECIPIENT_DEVICE =0,
TUSB_REQUEST_RECIPIENT_INTERFACE, TUSB_REQUEST_RECIPIENT_INTERFACE,
TUSB_REQUEST_RECIPIENT_ENDPOINT, TUSB_REQUEST_RECIPIENT_ENDPOINT,
TUSB_REQUEST_RECIPIENT_OTHER TUSB_REQUEST_RECIPIENT_OTHER
} tusb_std_request_recipient_t; } tusb_std_request_recipient_t;
typedef enum { typedef enum
{
TUSB_CLASS_UNSPECIFIED = 0 , ///< 0 TUSB_CLASS_UNSPECIFIED = 0 , ///< 0
TUSB_CLASS_AUDIO = 1 , ///< 1 TUSB_CLASS_AUDIO = 1 , ///< 1
TUSB_CLASS_CDC = 2 , ///< 2 TUSB_CLASS_CDC = 2 , ///< 2
@ -143,11 +151,13 @@ typedef enum {
TUSB_CLASS_VENDOR_SPECIFIC = 0xFF TUSB_CLASS_VENDOR_SPECIFIC = 0xFF
}tusb_std_class_code_t; }tusb_std_class_code_t;
typedef enum { typedef enum
{
MISC_SUBCLASS_COMMON = 2 MISC_SUBCLASS_COMMON = 2
}misc_subclass_type_t; }misc_subclass_type_t;
typedef enum { typedef enum
{
MISC_PROTOCOL_IAD = 1 MISC_PROTOCOL_IAD = 1
}misc_protocol_type_t; }misc_protocol_type_t;
@ -160,7 +170,8 @@ enum {
#define TUSB_DESC_CONFIG_POWER_MA(x) ((x)/2) #define TUSB_DESC_CONFIG_POWER_MA(x) ((x)/2)
/// Device State /// Device State
typedef enum { typedef enum
{
TUSB_DEVICE_STATE_UNPLUG = 0 , TUSB_DEVICE_STATE_UNPLUG = 0 ,
TUSB_DEVICE_STATE_ADDRESSED , TUSB_DEVICE_STATE_ADDRESSED ,
TUSB_DEVICE_STATE_CONFIGURED , TUSB_DEVICE_STATE_CONFIGURED ,
@ -172,7 +183,8 @@ typedef enum {
TUSB_DEVICE_STATE_INVALID_PARAMETER TUSB_DEVICE_STATE_INVALID_PARAMETER
}tusb_device_state_t; }tusb_device_state_t;
typedef enum { typedef enum
{
TUSB_EVENT_NONE = 0, TUSB_EVENT_NONE = 0,
TUSB_EVENT_XFER_COMPLETE, TUSB_EVENT_XFER_COMPLETE,
TUSB_EVENT_XFER_ERROR, TUSB_EVENT_XFER_ERROR,

View File

@ -131,7 +131,8 @@ enum {
}; };
//------------- SIE Command Code -------------// //------------- SIE Command Code -------------//
typedef enum { typedef enum
{
SIE_CMDPHASE_WRITE = 1, SIE_CMDPHASE_WRITE = 1,
SIE_CMDPHASE_READ = 2, SIE_CMDPHASE_READ = 2,
SIE_CMDPHASE_COMMAND = 5 SIE_CMDPHASE_COMMAND = 5
@ -176,7 +177,8 @@ enum {
SIE_SELECT_ENDPOINT_BUFFER2_FULL_MASK = BIT_(6) SIE_SELECT_ENDPOINT_BUFFER2_FULL_MASK = BIT_(6)
}; };
typedef enum { typedef enum
{
SIE_SET_ENDPOINT_STALLED_MASK = BIT_(0), SIE_SET_ENDPOINT_STALLED_MASK = BIT_(0),
SIE_SET_ENDPOINT_DISABLED_MASK = BIT_(5), SIE_SET_ENDPOINT_DISABLED_MASK = BIT_(5),
SIE_SET_ENDPOINT_RATE_FEEDBACK_MASK = BIT_(6), SIE_SET_ENDPOINT_RATE_FEEDBACK_MASK = BIT_(6),

View File

@ -114,7 +114,8 @@ bool tusbd_is_configured(uint8_t coreid)
//------------- OSAL Task -------------// //------------- OSAL Task -------------//
enum { USBD_TASK_QUEUE_DEPTH = 16 }; enum { USBD_TASK_QUEUE_DEPTH = 16 };
typedef enum { typedef enum
{
USBD_EVENTID_SETUP_RECEIVED = 1, USBD_EVENTID_SETUP_RECEIVED = 1,
USBD_EVENTID_XFER_DONE USBD_EVENTID_XFER_DONE
}usbd_eventid_t; }usbd_eventid_t;

View File

@ -59,7 +59,8 @@ enum {
USBD_INTERFACE_NUM_MAX = 16 // USB specs specify up to 16 endpoints per device USBD_INTERFACE_NUM_MAX = 16 // USB specs specify up to 16 endpoints per device
}; };
typedef enum { typedef enum
{
USBD_BUS_EVENT_RESET = 1, USBD_BUS_EVENT_RESET = 1,
USBD_BUS_EVENT_UNPLUGGED, USBD_BUS_EVENT_UNPLUGGED,
USBD_BUS_EVENT_SUSPENDED, USBD_BUS_EVENT_SUSPENDED,