Logo
MSP430USBDevelopersPackage_5_20_06_03
usb.h
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2016, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 /*
33  * ======== usb.h ========
34  */
35 #ifndef _USB_H_
36 #define _USB_H_
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 /*----------------------------------------------------------------------------+
44  | Constant Definition |
45  +----------------------------------------------------------------------------*/
46 #if defined(__TI_COMPILER_VERSION__) || defined(__GNUC__)
47 #define __no_init
48 #define __data16
49 #endif
50 
51 /*----------------------------------------------------------------------------
52  * The following macro names and function names are deprecated. These were
53  * updated to new names to follow OneMCU naming convention.
54  +---------------------------------------------------------------------------*/
55 
56 #ifndef DEPRECATED
57 #define kUSB_succeed USB_SUCCEED
58 #define kUSB_generalError USB_GENERAL_ERROR
59 #define kUSB_notEnabled USB_NOT_ENABLED
60 #define kUSB_vbusPresent USB_VBUS_PRESENT
61 #define kUSB_busActive USB_BUS_ACTIVE
62 #define kUSB_ConnectNoVBUS USB_CONNECT_NO_VBUS
63 #define kUSB_suspended USB_SUSPENDED
64 #define kUSB_NotSuspended USB_NOT_SUSPENDED
65 #define kUSB_Enumerated USB_ENUMERATED
66 #define kUSB_purHigh USB_PUR_HIGH
67 #define kUSB_clockFaultEvent USB_CLOCK_FAULT_EVENT
68 #define kUSB_VbusOnEvent USB_VBUS_ON_EVENT
69 #define kUSB_VbusOffEvent USB_VBUS_OFF_EVENT
70 #define kUSB_UsbResetEvent USB_RESET_EVENT
71 #define kUSB_UsbSuspendEvent USB_SUSPENDED_EVENT
72 #define kUSB_UsbResumeEvent USB_RESUME_EVENT
73 #define kUSB_dataReceivedEvent USB_DATA_RECEIVED_EVENT
74 #define kUSB_sendCompletedEvent USB_SEND_COMPLETED_EVENT
75 #define kUSB_receiveCompletedEvent USB_RECEIVED_COMPLETED_EVENT
76 #define kUSB_allUsbEvents USB_ALL_USB_EVENTS
77 
78 #define USB_connectionInfo USB_getConnectionInformation
79 #define USB_connectionState USB_getConnectionState
80 #define USB_handleEnumCompleteEvent USB_handleEnumerationCompleteEvent
81 #endif
82 
83 
84 #define FALSE 0
85 #define TRUE 1
86 
87 #define USB_RETURN_DATA_LENGTH 8
88 #define SIZEOF_DEVICE_REQUEST 0x08
89 
90 //Bit definitions for DEVICE_REQUEST.bmRequestType
91 //Bit 7: Data direction
92 #define USB_REQ_TYPE_OUTPUT 0x00 //0 = Host sending data to device
93 #define USB_REQ_TYPE_INPUT 0x80 //1 = Device sending data to host
94 
95 //Bit 6-5: Type
96 #define USB_REQ_TYPE_MASK 0x60 //Mask value for bits 6-5
97 #define USB_REQ_TYPE_STANDARD 0x00 //00 = Standard USB request
98 #define USB_REQ_TYPE_CLASS 0x20 //01 = Class specific
99 #define USB_REQ_TYPE_VENDOR 0x40 //10 = Vendor specific
100 
101 //Bit 4-0: Recipient
102 #define USB_REQ_TYPE_RECIP_MASK 0x1F //Mask value for bits 4-0
103 #define USB_REQ_TYPE_DEVICE 0x00 //00000 = Device
104 #define USB_REQ_TYPE_INTERFACE 0x01 //00001 = Interface
105 #define USB_REQ_TYPE_ENDPOINT 0x02 //00010 = Endpoint
106 #define USB_REQ_TYPE_OTHER 0x03 //00011 = Other
107 
108 //Values for DEVICE_REQUEST.bRequest
109 //Standard Device Requests
110 #define USB_REQ_GET_STATUS 0
111 #define USB_REQ_CLEAR_FEATURE 1
112 #define USB_REQ_SET_FEATURE 3
113 #define USB_REQ_SET_ADDRESS 5
114 #define USB_REQ_GET_DESCRIPTOR 6
115 #define USB_REQ_SET_DESCRIPTOR 7
116 #define USB_REQ_GET_CONFIGURATION 8
117 #define USB_REQ_SET_CONFIGURATION 9
118 #define USB_REQ_GET_INTERFACE 10
119 #define USB_REQ_SET_INTERFACE 11
120 #define USB_REQ_SYNCH_FRAME 12
121 
122 //CDC CLASS Requests
123 #define USB_CDC_GET_LINE_CODING 0x21
124 #define USB_CDC_SET_LINE_CODING 0x20
125 #define USB_CDC_SET_CONTROL_LINE_STATE 0x22
126 
127 //HID CLASS Requests
128 #define USB_HID_REQ 0x81
129 #define USB_REQ_GET_REPORT 0x01
130 #define USB_REQ_GET_IDLE 0x02
131 #define USB_REQ_SET_REPORT 0x09
132 #define USB_REQ_SET_IDLE 0x0A
133 #define USB_REQ_SET_PROTOCOL 0x0B
134 #define USB_REQ_GET_PROTOCOL 0x03
135 
136 //MSC CLASS Requests
137 #define USB_MSC_RESET_BULK 0xFF
138 #define USB_MSC_GET_MAX_LUN 0xFE
139 
140 // PHDC CLASS Requests
141 #define USB_PHDC_GET_STATUS 0x00
142 
143 //HID Values for HID Report Types (tSetup.bValueH)
144 #define USB_REQ_HID_INPUT 0x01
145 #define USB_REQ_HID_OUTPUT 0x02
146 #define USB_REQ_HID_FEATURE 0x03
147 
148 #define USB_REQ_HID_BOOT_PROTOCOL 0x00
149 #define USB_REQ_HID_REPORT_PROTOCOL 0x01
150 
151 
152 //Descriptor Type Values
153 #define DESC_TYPE_DEVICE 1 //Device Descriptor (Type 1)
154 #define DESC_TYPE_CONFIG 2 //Configuration Descriptor (Type 2)
155 #define DESC_TYPE_STRING 3 //String Descriptor (Type 3)
156 #define DESC_TYPE_INTERFACE 4 //Interface Descriptor (Type 4)
157 #define DESC_TYPE_ENDPOINT 5 //Endpoint Descriptor (Type 5)
158 #define DESC_TYPE_DEVICE_QUALIFIER 6 //Endpoint Descriptor (Type 6)
159 #define DESC_TYPE_IAD 0x0B
160 #define DESC_TYPE_HUB 0x29 //Hub Descriptor (Type 6)
161 #define DESC_TYPE_HID 0x21 //HID Descriptor
162 #define DESC_TYPE_REPORT 0x22 //Report Descriptor
163 #define DESC_TYPE_PHYSICAL 0x23 //Physical Descriptor
164 
165 //Feature Selector Values
166 #define FEATURE_REMOTE_WAKEUP 1 //Remote wakeup (Type 1)
167 #define FEATURE_ENDPOINT_STALL 0 //Endpoint stall (Type 0)
168 
169 //Device Status Values
170 #define DEVICE_STATUS_REMOTE_WAKEUP 0x02
171 #define DEVICE_STATUS_SELF_POWER 0x01
172 
173 //Maximum descriptor size
174 #define MAX_DESC_SIZE 256
175 
176 //DEVICE_DESCRIPTOR structure
177 #define SIZEOF_DEVICE_DESCRIPTOR 0x12
178 #define OFFSET_DEVICE_DESCRIPTOR_VID_L 0x08
179 #define OFFSET_DEVICE_DESCRIPTOR_VID_H 0x09
180 #define OFFSET_DEVICE_DESCRIPTOR_PID_L 0x0A
181 #define OFFSET_DEVICE_DESCRIPTOR_PID_H 0x0B
182 #define OFFSET_CONFIG_DESCRIPTOR_POWER 0x07
183 #define OFFSET_CONFIG_DESCRIPTOR_CURT 0x08
184 
185 //CONFIG_DESCRIPTOR structure
186 #define SIZEOF_CONFIG_DESCRIPTOR 0x09
187 
188 //HID DESCRIPTOR structure
189 //#define SIZEOF_HID_DESCRIPTOR 0x09
190 
191 //Bit definitions for CONFIG_DESCRIPTOR.bmAttributes
192 #define CFG_DESC_ATTR_SELF_POWERED 0x40 //Bit 6: If set, device is self powered
193 #define CFG_DESC_ATTR_BUS_POWERED 0x80 //Bit 7: If set, device is bus powered
194 #define CFG_DESC_ATTR_REMOTE_WAKE 0x20 //Bit 5: If set, device supports remote wakeup
195 
196 //INTERFACE_DESCRIPTOR structure
197 #define SIZEOF_INTERFACE_DESCRIPTOR 0x09
198 
199 //ENDPOINT_DESCRIPTOR structure
200 #define SIZEOF_ENDPOINT_DESCRIPTOR 0x07
201 
202 //Bit definitions for EndpointDescriptor.EndpointAddr
203 #define EP_DESC_ADDR_EP_NUM 0x0F //Bit 3-0: Endpoint number
204 #define EP_DESC_ADDR_DIR_IN 0x80 //Bit 7: Direction of endpoint, 1/0 = In/Out
205 
206 //Bit definitions for EndpointDescriptor.EndpointFlags
207 #define EP_DESC_ATTR_TYPE_MASK 0x03 //Mask value for bits 1-0
208 #define EP_DESC_ATTR_TYPE_CONT 0x00 //Bit 1-0: 00 = Endpoint does control transfers
209 #define EP_DESC_ATTR_TYPE_ISOC 0x01 //Bit 1-0: 01 = Endpoint does isochronous transfers
210 #define EP_DESC_ATTR_TYPE_BULK 0x02 //Bit 1-0: 10 = Endpoint does bulk transfers
211 #define EP_DESC_ATTR_TYPE_INT 0x03 //Bit 1-0: 11 = Endpoint does interrupt transfers
212 
213 //Definition to indicate valid/invalid data
214 #define DATA_VALID 1
215 #define DATA_INVALID 0
216 
217 typedef enum {
218  STATUS_ACTION_NOTHING,
219  STATUS_ACTION_DATA_IN,
220  STATUS_ACTION_DATA_OUT
221 } tSTATUS_ACTION_LIST;
222 
223 
224 typedef struct _tDEVICE_REQUEST {
225  uint8_t bmRequestType; //See bit definitions below
226  uint8_t bRequest; //See value definitions below
227  uint16_t wValue; //Meaning varies with request type
228  uint16_t wIndex; //Meaning varies with request type
229  uint16_t wLength; //Number of bytes of data to transfer
231 
232 extern __no_init tDEVICE_REQUEST __data16 tSetupPacket;
233 extern __no_init uint8_t __data16 abIEP0Buffer[];
234 extern __no_init uint8_t __data16 abOEP0Buffer[];
235 extern __no_init uint8_t __data16 pbXBufferAddressEp1[];
236 extern __no_init uint8_t __data16 pbYBufferAddressEp1[];
237 extern __no_init uint8_t __data16 pbXBufferAddressEp81[];
238 extern __no_init uint8_t __data16 pbYBufferAddressEp81[];
239 extern __no_init uint8_t __data16 pbXBufferAddressEp2[];
240 extern __no_init uint8_t __data16 pbYBufferAddressEp2[];
241 extern __no_init uint8_t __data16 pbXBufferAddressEp82[];
242 extern __no_init uint8_t __data16 pbYBufferAddressEp82[];
243 
244 extern __no_init uint8_t __data16 pbXBufferAddressEp3[];
245 extern __no_init uint8_t __data16 pbYBufferAddressEp3[];
246 extern __no_init uint8_t __data16 pbXBufferAddressEp83[];
247 extern __no_init uint8_t __data16 pbYBufferAddressEp83[];
248 
249 extern __no_init uint8_t __data16 pbXBufferAddressEp4[];
250 extern __no_init uint8_t __data16 pbYBufferAddressEp4[];
251 extern __no_init uint8_t __data16 pbXBufferAddressEp84[];
252 extern __no_init uint8_t __data16 pbYBufferAddressEp84[];
253 
254 extern __no_init uint8_t __data16 pbXBufferAddressEp5[];
255 extern __no_init uint8_t __data16 pbYBufferAddressEp5[];
256 extern __no_init uint8_t __data16 pbXBufferAddressEp85[];
257 extern __no_init uint8_t __data16 pbYBufferAddressEp85[];
258 
259 
260 extern __no_init uint8_t __data16 pbXBufferAddressEp6[];
261 extern __no_init uint8_t __data16 pbYBufferAddressEp6[];
262 extern __no_init uint8_t __data16 pbXBufferAddressEp86[];
263 extern __no_init uint8_t __data16 pbYBufferAddressEp86[];
264 
265 extern __no_init uint8_t __data16 pbXBufferAddressEp7[];
266 extern __no_init uint8_t __data16 pbYBufferAddressEp7[];
267 extern __no_init uint8_t __data16 pbXBufferAddressEp87[];
268 extern __no_init uint8_t __data16 pbYBufferAddressEp87[];
269 
270 extern uint16_t wBytesRemainingOnIEP0;
271 extern uint16_t wBytesRemainingOnOEP0;
272 extern uint8_t abUsbRequestReturnData[];
273 extern uint8_t abUsbRequestIncomingData[];
274 extern uint8_t bEnumerationStatus;
275 extern uint8_t bFunctionSuspended;
276 
277 //Function return values
278 #define USB_SUCCEED 0x00
279 #define USB_GENERAL_ERROR 0x01
280 #define USB_NOT_ENABLED 0x02
281 //#define kUSB_VbusNotPresent 0x03
282 
283 //return values USB_getConnectionInformation(), USB_connect()
284 #define USB_VBUS_PRESENT 0x01
285 #define USB_BUS_ACTIVE 0x02 //frame sync packets are being received
286 #define USB_CONNECT_NO_VBUS 0x04
287 #define USB_SUSPENDED 0x08
288 #define USB_NOT_SUSPENDED 0x10
289 #define USB_ENUMERATED 0x20
290 #define USB_PUR_HIGH 0x40
291 
292 //Parameters for function USB_setEnabledEvents()
293 #define USB_CLOCK_FAULT_EVENT 0x0001
294 #define USB_VBUS_ON_EVENT 0x0002
295 #define USB_VBUS_OFF_EVENT 0x0004
296 #define USB_RESET_EVENT 0x0008
297 #define USB_SUSPENDED_EVENT 0x0010
298 #define USB_RESUME_EVENT 0x0020
299 #define USB_DATA_RECEIVED_EVENT 0x0040
300 #define USB_SEND_COMPLETED_EVENT 0x0080
301 #define USB_RECEIVED_COMPLETED_EVENT 0x0100
302 #define USB_ALL_USB_EVENTS 0x01FF
303 
304 //USB connection states
305 #define ST_USB_DISCONNECTED 0x80
306 #define ST_USB_CONNECTED_NO_ENUM 0x81
307 #define ST_ENUM_IN_PROGRESS 0x82
308 #define ST_ENUM_ACTIVE 0x83
309 #define ST_ENUM_SUSPENDED 0x84
310 //#define ST_FAILED_ENUM 0x85
311 #define ST_ERROR 0x86
312 #define ST_NOENUM_SUSPENDED 0x87
313 
314 #define ST_PHYS_DISCONNECTED ST_USB_DISCONNECTED
315 #define ST_PHYS_CONNECTED_NOENUM ST_USB_CONNECTED_NO_ENUM
316 #define ST_PHYS_CONNECTED_NOENUM_SUSP ST_NOENUM_SUSPENDED
317 
318 #define USB_CLOCKFAULT_EVENTMASK USB_CLOCK_FAULT_EVENT
319 #define USB_VBUSON_EVENTMASK USB_VBUS_ON_EVENT
320 #define USB_VBUSOFF_EVENTMASK USB_VBUS_OFF_EVENT
321 #define USB_USBRESET_EVENTMASK USB_RESET_EVENT
322 #define USB_USBSUSPEND_EVENTMASK USB_SUSPENDED_EVENT
323 #define USB_USBRESUME_EVENTMASK USB_RESUME_EVENT
324 #define USB_DATARECEIVED_EVENTMASK USB_DATA_RECEIVED_EVENT
325 #define USB_SENDCOMPLETED_EVENTMASK USB_SEND_COMPLETED_EVENT
326 #define USB_RECEIVECOMPLETED_EVENTMASK USB_RECEIVED_COMPLETED_EVENT
327 #define USB_ALL_EVENTMASK USB_ALL_USB_EVENTS
328 
329 #define SUCCESS 0
330 #define FAILURE 1
331 
332 typedef struct _tDEVICE_REQUEST_COMPARE {
333  uint8_t bmRequestType; //See bit definitions below
334  uint8_t bRequest; //See value definitions below
335  uint8_t bValueL; //Meaning varies with request type
336  uint8_t bValueH; //Meaning varies with request type
337  uint8_t bIndexL; //Meaning varies with request type
338  uint8_t bIndexH; //Meaning varies with request type
339  uint8_t bLengthL; //Number of bytes of data to transfer (LSByte)
340  uint8_t bLengthH; //Number of bytes of data to transfer (MSByte)
341  uint8_t bCompareMask; //MSB is bRequest, if set 1, bRequest should be matched
342  uint8_t (*pUsbFunction)(void); //function pointer
344 
345 void usbStallInEndpoint(uint8_t);
346 void usbStallOutEndpoint(uint8_t);
347 void usbStallEndpoint(uint8_t);
348 void usbClearOEPByteCount(uint8_t);
349 
350 /*----------------------------------------------------------------------------
351  * These functions can be used in application
352  +----------------------------------------------------------------------------*/
353 
354 /*
355  * MSP430 USB Module Management functions
356  */
357 
358 //*****************************************************************************
359 //
362 //
363 //******************************************************************************
364 
365 
366 //*****************************************************************************
367 //
382 //
383 //*****************************************************************************
384 
385 uint8_t USB_init(void);
386 
387 //*****************************************************************************
388 //
406 //
407 //*****************************************************************************
408 uint8_t USB_setup(uint8_t connectEnable, uint8_t eventsEnable);
409 
410 //*****************************************************************************
411 //
423 //
424 //*****************************************************************************
425 uint8_t USB_enable ();
426 
427 #ifdef USE_TIMER_FOR_RESUME
428 
429 //*****************************************************************************
430 //
443 //
444 //*****************************************************************************
445 uint8_t USB_enable_crystal (void);
446 
447 //*****************************************************************************
448 //
461 //
462 //*****************************************************************************
463 void USB_enable_PLL(void);
464 
465 //*****************************************************************************
466 //
474 //
475 //*****************************************************************************
476 void USB_enable_final(void);
477 
478 #endif
479 
480 //*****************************************************************************
481 //
493 //
494 //*****************************************************************************
495 uint8_t USB_disable(void);
496 
497 //*****************************************************************************
498 //
535 //
536 //*****************************************************************************
537 uint8_t USB_setEnabledEvents (uint16_t events);
538 
539 
540 //*****************************************************************************
541 //
552 //
553 //*****************************************************************************
554 uint16_t USB_getEnabledEvents ();
555 
556 //*****************************************************************************
557 //
565 //
566 //*****************************************************************************
567 uint8_t USB_connect ();
568 
569 
570 
571 //*****************************************************************************
572 //
581 //
582 //*****************************************************************************
583 uint8_t USB_disconnect ();
584 //*****************************************************************************
585 //
597 //
598 //*****************************************************************************
599 uint8_t USB_reset ();
600 
604 uint8_t USB_suspend(void);
605 
609 uint8_t USB_resume(void);
610 
611 
612 //*****************************************************************************
613 //
625 //
626 //*****************************************************************************
627 uint8_t USB_forceRemoteWakeup ();
628 
629 //*****************************************************************************
630 //
645 //
646 //*****************************************************************************
648 
649 //*****************************************************************************
650 //
664 //
665 //*****************************************************************************
666 uint8_t USB_getConnectionState ();
667 
668 #ifdef NON_COMPOSITE_MULTIPLE_INTERFACES
669 /*
670  * Switch to a different USB configuration. Used only for non-composite devices with multiple configuratons.
671  */
672 uint8_t USB_switchInterface(uint8_t interfaceIndex);
673 
674 #endif
675 //******************************************************************************
676 //
677 // Close the Doxygen group.
679 //
680 //******************************************************************************
681 
682 /*
683  * Event-Handling routines
684  */
685 
686 //*****************************************************************************
687 //
690 //
691 //******************************************************************************
692 
693 
694 //******************************************************************************
695 //
708 //
709 //******************************************************************************
710 
711 uint8_t USB_handleClockEvent ();
712 
713 //*****************************************************************************
714 //
730 //
731 //*****************************************************************************
732 uint8_t USB_handleVbusOnEvent ();
733 
734 //*****************************************************************************
735 //
753 //
754 //*****************************************************************************
755 uint8_t USB_handleVbusOffEvent ();
756 
757 //*****************************************************************************
758 //
768 //
769 //*****************************************************************************
770 uint8_t USB_handleResetEvent ();
771 
772 //*****************************************************************************
773 //
788 //
789 //*****************************************************************************
790 uint8_t USB_handleSuspendEvent ();
791 
792 //*****************************************************************************
793 //
806 //
807 //*****************************************************************************
808 uint8_t USB_handleResumeEvent ();
809 
810 //*****************************************************************************
811 //
821 //
822 //*****************************************************************************
824 
825 #ifdef USE_TIMER_FOR_RESUME
826 /*
827  * When this function gets executed, it indicates that a USB_resume is in progress and the USB
828  * stack requires the application to use a timer to wait until the XT2 crystal has
829  * stabilized. See crystal specific datasheet for delay times. When the crystal has
830  * stabilized the application needs to call the function USB_enable_PLL() to allow
831  * resume to continue.
832  */
833 void USB_handleCrystalStartedEvent(void);
834 
835 /*
836  * When this function gets executed, it indicates that a USB_resume is in progress and the USB
837  * stack requires the application to use a timer to wait until the USB PLL has
838  * stabilized. See device specific datasheet for PLL delay times. When the PLL has
839  * stabilized the application needs to call the function USB_enable_final() to allow resume
840  * to complete.
841  */
842 void USB_handlePLLStartedEvent(void);
843 
844 #endif
845 
846 //******************************************************************************
847 //
848 // Close the Doxygen group.
850 //
851 //******************************************************************************
852 
856 void usbStallEndpoint0(void);
857 
861 void usbClearOEP0ByteCount(void);
862 
866 void usbStallOEP0(void);
867 
872 void usbSendNextPacketOnIEP0(void);
873 
879 void usbSendDataPacketOnEP0 (const uint8_t* pbBuffer);
880 
885 void usbReceiveNextPacketOnOEP0(void);
886 
892 void usbReceiveDataPacketOnEP0 (uint8_t* pbBuffer);
893 
897 void usbSendZeroLengthPacketOnIEP0(void);
898 
899 /*Send data to host.*/
900 uint8_t MscSendData (const uint8_t* data, uint16_t size);
901 
906 uint8_t usbDecodeAndProcessUsbRequest(void);
907 uint8_t usbClearEndpointFeature(void);
908 uint8_t usbGetConfiguration(void);
909 uint8_t usbGetDeviceDescriptor(void);
910 uint8_t usbGetConfigurationDescriptor(void);
911 uint8_t usbGetStringDescriptor(void);
912 uint8_t usbGetInterface(void);
913 uint8_t usbGetDeviceStatus(void);
914 uint8_t usbGetEndpointStatus(void);
915 uint8_t usbGetInterfaceStatus(void);
916 uint8_t usbSetAddress(void);
917 uint8_t usbSetConfiguration(void);
918 uint8_t usbClearDeviceFeature(void);
919 uint8_t usbSetDeviceFeature(void);
920 uint8_t usbSetEndpointFeature(void);
921 uint8_t usbSetInterface(void);
922 uint8_t usbInvalidRequest(void);
923 uint16_t usbDisableInEndpointInterrupt(uint8_t edbIndex);
924 void usbRestoreInEndpointInterrupt(uint16_t state);
925 uint16_t usbDisableOutEndpointInterrupt(uint8_t edbIndex);
926 void usbRestoreOutEndpointInterrupt(uint16_t state);
927 
928 #define ENUMERATION_COMPLETE 0x01
929 
930 /*----------------------------------------------------------------------------+
931  | End of header file |
932  +----------------------------------------------------------------------------*/
933 #ifdef __cplusplus
934 }
935 #endif
936 #endif /*
937  * _USB_H
938  *------------------------ Nothing Below This Line --------------------------
939  */
uint8_t USB_handleResumeEvent()
uint8_t USB_handleSuspendEvent()
uint8_t USB_resume(void)
uint8_t USB_getConnectionInformation()
uint8_t USB_reset()
uint8_t USB_connect()
Definition: usb.h:332
uint8_t USB_forceRemoteWakeup()
uint8_t USB_disable(void)
uint8_t USB_handleEnumerationCompleteEvent()
uint8_t USB_handleClockEvent()
uint8_t USB_suspend(void)
uint8_t USB_handleVbusOnEvent()
uint8_t USB_setup(uint8_t connectEnable, uint8_t eventsEnable)
uint8_t USB_enable()
uint16_t USB_getEnabledEvents()
uint8_t USB_init(void)
uint8_t USB_handleVbusOffEvent()
uint8_t USB_disconnect()
uint8_t USB_getConnectionState()
uint8_t USB_setEnabledEvents(uint16_t events)
uint8_t USB_handleResetEvent()
Definition: usb.h:224