00001 /******************** (C) COPYRIGHT 2010 STMicroelectronics ******************** 00002 * File Name : usb_def.h 00003 * Author : MCD Application Team 00004 * Version : V3.1.1 00005 * Date : 04/07/2010 00006 * Description : Definitions related to USB Core 00007 ******************************************************************************** 00008 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 00012 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 00014 *******************************************************************************/ 00015 00016 /* Define to prevent recursive inclusion -------------------------------------*/ 00017 #ifndef __USB_DEF_H 00018 #define __USB_DEF_H 00019 00020 /* Includes ------------------------------------------------------------------*/ 00021 /* Exported types ------------------------------------------------------------*/ 00022 typedef enum _RECIPIENT_TYPE 00023 { 00024 DEVICE_RECIPIENT, /* Recipient device */ 00025 INTERFACE_RECIPIENT, /* Recipient interface */ 00026 ENDPOINT_RECIPIENT, /* Recipient endpoint */ 00027 OTHER_RECIPIENT 00028 } RECIPIENT_TYPE; 00029 00030 00031 typedef enum _STANDARD_REQUESTS 00032 { 00033 GET_STATUS = 0, 00034 CLEAR_FEATURE, 00035 RESERVED1, 00036 SET_FEATURE, 00037 RESERVED2, 00038 SET_ADDRESS, 00039 GET_DESCRIPTOR, 00040 SET_DESCRIPTOR, 00041 GET_CONFIGURATION, 00042 SET_CONFIGURATION, 00043 GET_INTERFACE, 00044 SET_INTERFACE, 00045 TOTAL_sREQUEST, /* Total number of Standard request */ 00046 SYNCH_FRAME = 12 00047 } STANDARD_REQUESTS; 00048 00049 /* Definition of "USBwValue" */ 00050 typedef enum _DESCRIPTOR_TYPE 00051 { 00052 DEVICE_DESCRIPTOR = 1, 00053 CONFIG_DESCRIPTOR, 00054 STRING_DESCRIPTOR, 00055 INTERFACE_DESCRIPTOR, 00056 ENDPOINT_DESCRIPTOR 00057 } DESCRIPTOR_TYPE; 00058 00059 /* Feature selector of a SET_FEATURE or CLEAR_FEATURE */ 00060 typedef enum _FEATURE_SELECTOR 00061 { 00062 ENDPOINT_STALL, 00063 DEVICE_REMOTE_WAKEUP 00064 } FEATURE_SELECTOR; 00065 00066 /* Exported constants --------------------------------------------------------*/ 00067 /* Definition of "USBbmRequestType" */ 00068 #define REQUEST_TYPE 0x60 /* Mask to get request type */ 00069 #define STANDARD_REQUEST 0x00 /* Standard request */ 00070 #define CLASS_REQUEST 0x20 /* Class request */ 00071 #define VENDOR_REQUEST 0x40 /* Vendor request */ 00072 00073 #define RECIPIENT 0x1F /* Mask to get recipient */ 00074 00075 /* Exported macro ------------------------------------------------------------*/ 00076 /* Exported functions ------------------------------------------------------- */ 00077 00078 #endif /* __USB_DEF_H */ 00079 00080 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/