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