78 #define Usb_send_event(x) (g_usb_event |= (1<<x))
80 #define Usb_ack_event(x) (g_usb_event &= ~(1<<x))
82 #define Usb_clear_all_event() (g_usb_event = 0)
84 #define Is_usb_event(x) ((g_usb_event & (1<<x)) ? TRUE : FALSE)
86 #define Is_not_usb_event(x) ((g_usb_event & (1<<x)) ? FALSE: TRUE)
88 #define Is_usb_device() (g_usb_mode==USB_MODE_DEVICE ? TRUE : FALSE)
92 #define EVT_USB_POWERED 1
94 #define EVT_USB_UNPOWERED 2
96 #define EVT_USB_DEVICE_FUNCTION 3
98 #define EVT_USB_HOST_FUNCTION 4
100 #define EVT_USB_SUSPEND 5
102 #define EVT_USB_WAKE_UP 6
104 #define EVT_USB_RESUME 7
106 #define EVT_USB_RESET 8
108 #define EVT_USB_SETUP_RX 9
114 #define GET_STATUS 0x00
115 #define GET_DEVICE 0x01
116 #define CLEAR_FEATURE 0x01
117 #define GET_STRING 0x03
118 #define SET_FEATURE 0x03
119 #define SET_ADDRESS 0x05
120 #define GET_DESCRIPTOR 0x06
121 #define SET_DESCRIPTOR 0x07
122 #define GET_CONFIGURATION 0x08
123 #define SET_CONFIGURATION 0x09
124 #define GET_INTERFACE 0x0A
125 #define SET_INTERFACE 0x0B
126 #define SYNCH_FRAME 0x0C
128 #define GET_DEVICE_DESCRIPTOR 1
129 #define GET_CONFIGURATION_DESCRIPTOR 4
131 #define REQUEST_DEVICE_STATUS 0x80
132 #define REQUEST_INTERFACE_STATUS 0x81
133 #define REQUEST_ENDPOINT_STATUS 0x82
134 #define ZERO_TYPE 0x00
135 #define INTERFACE_TYPE 0x01
136 #define ENDPOINT_TYPE 0x02
139 #define DEVICE_DESCRIPTOR 0x01
140 #define CONFIGURATION_DESCRIPTOR 0x02
141 #define STRING_DESCRIPTOR 0x03
142 #define INTERFACE_DESCRIPTOR 0x04
143 #define ENDPOINT_DESCRIPTOR 0x05
144 #define DEVICE_QUALIFIER_DESCRIPTOR 0x06
145 #define OTHER_SPEED_CONFIGURATION_DESCRIPTOR 0x07
150 #define FEATURE_DEVICE_REMOTE_WAKEUP 0x01
151 #define FEATURE_ENDPOINT_HALT 0x00
155 #define TEST_SEO_NAK 0x03
156 #define TEST_PACKET 0x04
157 #define TEST_FORCE_ENABLE 0x05
161 #define BUS_POWERED 0
162 #define SELF_POWERED 1
166 #define USB_MODE_UNDEFINED 0x00
167 #define USB_MODE_HOST 0x01
168 #define USB_MODE_DEVICE 0x02
181 extern uint8_t g_usb_mode;
186 extern volatile uint8_t private_sof_counter;
189 void usb_device_task (
void);
volatile uint16_t g_usb_event
Public : U16 g_usb_event usb_connected is used to store USB events detected upon USB general interrup...
void usb_start_device(void)
This function initializes the USB device controller.
#define PROCESS_NAME(name)
Declare the name of a process.