00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _USB_ENUM_H_
00024 #define _USB_ENUM_H_
00025
00026
00027
00028 #include "modules/usb/usb_task.h"
00029 #include "usb_descriptors.h"
00030
00031
00032
00033
00034
00037
00038
00039
00040
00041 #define ATTACHED 0
00042 #define POWERED 1
00043 #define DEFAULT 2
00044 #define ADDRESSED 3
00045 #define CONFIGURED 4
00046 #define SUSPENDED 5
00047
00048 #define USB_CONFIG_ATTRIBUTES_RESERVED 0x80
00049 #define USB_CONFIG_BUSPOWERED (USB_CONFIG_ATTRIBUTES_RESERVED | 0x00)
00050 #define USB_CONFIG_SELFPOWERED (USB_CONFIG_ATTRIBUTES_RESERVED | 0x40)
00051 #define USB_CONFIG_REMOTEWAKEUP (USB_CONFIG_ATTRIBUTES_RESERVED | 0x20)
00052
00053 #define USB_REMOTE_WAKEUP 1
00054 #define OTG_B_HNP_ENABLE 3
00055 #define OTG_A_HNP_SUPPORT 4
00056 #define OTG_A_ALT_HNP_SUPPORT 5
00057
00058
00059
00060
00063 #define Is_device_enumerated() ((usb_configuration_nb!=0) ? TRUE : FALSE)
00064 #define Is_device_not_enumerated() ((usb_configuration_nb!=0) ? FALSE : TRUE)
00065
00068 #define Is_host_supports_hnp() (((otg_features_supported&OTG_A_HNP_SUPPORT) != 0) ? TRUE : FALSE)
00069 #define Is_host_requested_hnp() (((otg_features_supported&OTG_B_HNP_ENABLE) != 0) ? TRUE : FALSE)
00070 #define Clear_otg_features_from_host() (otg_features_supported = 0)
00071
00091 void usb_process_request( void);
00092
00093 extern U8 usb_configuration_nb;
00094
00095 extern U8 otg_device_nb_hnp_retry;
00096
00098
00099 #endif // _USB_ENUM_H_
00100