USBDevice for STM support
Dependents: DISCO-F429ZI_LCDTS_demo_richard
Fork of USBDEVICE by
USBDevice/USBEndpoints_EFM32.h@6:5a6efd08d588, 2017-06-27 (annotated)
- Committer:
- pierrebizouard
- Date:
- Tue Jun 27 13:11:46 2017 +0000
- Revision:
- 6:5a6efd08d588
- Parent:
- 1:2a3ae13b45ef
fixup in definition
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 1 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 2 | #ifndef TARGET_EFM32HG_STK3400 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 3 | # define NUMBER_OF_LOGICAL_ENDPOINTS (6) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 4 | #else |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 5 | # define NUMBER_OF_LOGICAL_ENDPOINTS (3) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 6 | #endif |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 7 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 8 | #define NUMBER_OF_PHYSICAL_ENDPOINTS (NUMBER_OF_LOGICAL_ENDPOINTS * 2) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 9 | #define NUMBER_OF_ENDPOINTS (NUMBER_OF_PHYSICAL_ENDPOINTS + 2) /* Includes EP0 */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 10 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 11 | #define EP0OUT (0) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 12 | #define EP0IN (1) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 13 | #define EP1OUT (2) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 14 | #define EP1IN (3) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 15 | #define EP2OUT (4) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 16 | #define EP2IN (5) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 17 | #define EP3OUT (6) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 18 | #define EP3IN (7) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 19 | #ifndef TARGET_EFM32HG_STK3400 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 20 | # define EP4OUT (8) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 21 | # define EP4IN (9) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 22 | # define EP5OUT (10) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 23 | # define EP5IN (11) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 24 | # define EP6OUT (12) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 25 | # define EP6IN (13) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 26 | #endif |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 27 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 28 | #define USB_EP_TO_INDEX(ep) (ep) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 29 | #define USB_EP_TO_ADDR(ep) (((ep)>>1) | (((ep) & 1 ) ? 0x80 : 0x00)) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 30 | #define USB_ADDR_TO_EP(ep) (((ep)<<1) | (((ep) & 0x80) ? 0x01 : 0x00)) |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 31 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 32 | /* Maximum Packet sizes */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 33 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 34 | #define MAX_PACKET_SIZE_EP0 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 35 | #define MAX_PACKET_SIZE_EP1 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 36 | #define MAX_PACKET_SIZE_EP2 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 37 | #define MAX_PACKET_SIZE_EP3 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 38 | #ifndef TARGET_EFM32HG_STK3400 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 39 | # define MAX_PACKET_SIZE_EP4 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 40 | # define MAX_PACKET_SIZE_EP5 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 41 | # define MAX_PACKET_SIZE_EP6 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 42 | #endif |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 43 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 44 | /* Generic endpoints - intended to be portable accross devices */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 45 | /* and be suitable for simple USB devices. */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 46 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 47 | /* Bulk endpoints */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 48 | #define EPBULK_OUT EP2OUT |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 49 | #define EPBULK_IN EP2IN |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 50 | #define EPBULK_OUT_callback EP2_OUT_callback |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 51 | #define EPBULK_IN_callback EP2_IN_callback |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 52 | /* Interrupt endpoints */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 53 | #define EPINT_OUT EP1OUT |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 54 | #define EPINT_IN EP1IN |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 55 | #define EPINT_OUT_callback EP1_OUT_callback |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 56 | #define EPINT_IN_callback EP1_IN_callback |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 57 | /* Isochronous endpoints */ |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 58 | #define EPISO_OUT EP3OUT |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 59 | #define EPISO_IN EP3IN |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 60 | #define EPISO_OUT_callback EP3_OUT_callback |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 61 | #define EPISO_IN_callback EP3_IN_callback |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 62 | |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 63 | #define MAX_PACKET_SIZE_EPBULK 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 64 | #define MAX_PACKET_SIZE_EPINT 64 |
frq08711@LMECWL0871.LME.ST.COM | 1:2a3ae13b45ef | 65 | #define MAX_PACKET_SIZE_EPISO 1023 |