A copy of the mbed USBDevice with USBSerial library
Dependents: STM32L0_LoRa Smartage STM32L0_LoRa Turtle_RadioShuttle
targets/TARGET_Silicon_Labs/USBEndpoints_EFM32.h@8:961423d1da74, 2019-02-24 (annotated)
- Committer:
- Helmut Tschemernjak
- Date:
- Sun Feb 24 14:52:33 2019 +0100
- Revision:
- 8:961423d1da74
- Parent:
- 0:a3ea811f80f2
Added sleep manager support to avoids sleeps while a USB CDC
connection is active
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Helmut64 | 0:a3ea811f80f2 | 1 | |
Helmut64 | 0:a3ea811f80f2 | 2 | #ifndef TARGET_EFM32HG_STK3400 |
Helmut64 | 0:a3ea811f80f2 | 3 | # define NUMBER_OF_LOGICAL_ENDPOINTS (6) |
Helmut64 | 0:a3ea811f80f2 | 4 | #else |
Helmut64 | 0:a3ea811f80f2 | 5 | # define NUMBER_OF_LOGICAL_ENDPOINTS (3) |
Helmut64 | 0:a3ea811f80f2 | 6 | #endif |
Helmut64 | 0:a3ea811f80f2 | 7 | |
Helmut64 | 0:a3ea811f80f2 | 8 | #define NUMBER_OF_PHYSICAL_ENDPOINTS (NUMBER_OF_LOGICAL_ENDPOINTS * 2) |
Helmut64 | 0:a3ea811f80f2 | 9 | #define NUMBER_OF_ENDPOINTS (NUMBER_OF_PHYSICAL_ENDPOINTS + 2) /* Includes EP0 */ |
Helmut64 | 0:a3ea811f80f2 | 10 | |
Helmut64 | 0:a3ea811f80f2 | 11 | #define EP0OUT (0) |
Helmut64 | 0:a3ea811f80f2 | 12 | #define EP0IN (1) |
Helmut64 | 0:a3ea811f80f2 | 13 | #define EP1OUT (2) |
Helmut64 | 0:a3ea811f80f2 | 14 | #define EP1IN (3) |
Helmut64 | 0:a3ea811f80f2 | 15 | #define EP2OUT (4) |
Helmut64 | 0:a3ea811f80f2 | 16 | #define EP2IN (5) |
Helmut64 | 0:a3ea811f80f2 | 17 | #define EP3OUT (6) |
Helmut64 | 0:a3ea811f80f2 | 18 | #define EP3IN (7) |
Helmut64 | 0:a3ea811f80f2 | 19 | #ifndef TARGET_EFM32HG_STK3400 |
Helmut64 | 0:a3ea811f80f2 | 20 | # define EP4OUT (8) |
Helmut64 | 0:a3ea811f80f2 | 21 | # define EP4IN (9) |
Helmut64 | 0:a3ea811f80f2 | 22 | # define EP5OUT (10) |
Helmut64 | 0:a3ea811f80f2 | 23 | # define EP5IN (11) |
Helmut64 | 0:a3ea811f80f2 | 24 | # define EP6OUT (12) |
Helmut64 | 0:a3ea811f80f2 | 25 | # define EP6IN (13) |
Helmut64 | 0:a3ea811f80f2 | 26 | #endif |
Helmut64 | 0:a3ea811f80f2 | 27 | |
Helmut64 | 0:a3ea811f80f2 | 28 | #define USB_EP_TO_INDEX(ep) (ep) |
Helmut64 | 0:a3ea811f80f2 | 29 | #define USB_EP_TO_ADDR(ep) (((ep)>>1) | (((ep) & 1 ) ? 0x80 : 0x00)) |
Helmut64 | 0:a3ea811f80f2 | 30 | #define USB_ADDR_TO_EP(ep) (((ep)<<1) | (((ep) & 0x80) ? 0x01 : 0x00)) |
Helmut64 | 0:a3ea811f80f2 | 31 | |
Helmut64 | 0:a3ea811f80f2 | 32 | /* Maximum Packet sizes */ |
Helmut64 | 0:a3ea811f80f2 | 33 | |
Helmut64 | 0:a3ea811f80f2 | 34 | #define MAX_PACKET_SIZE_EP0 64 |
Helmut64 | 0:a3ea811f80f2 | 35 | #define MAX_PACKET_SIZE_EP1 64 |
Helmut64 | 0:a3ea811f80f2 | 36 | #define MAX_PACKET_SIZE_EP2 64 |
Helmut64 | 0:a3ea811f80f2 | 37 | #define MAX_PACKET_SIZE_EP3 64 |
Helmut64 | 0:a3ea811f80f2 | 38 | #ifndef TARGET_EFM32HG_STK3400 |
Helmut64 | 0:a3ea811f80f2 | 39 | # define MAX_PACKET_SIZE_EP4 64 |
Helmut64 | 0:a3ea811f80f2 | 40 | # define MAX_PACKET_SIZE_EP5 64 |
Helmut64 | 0:a3ea811f80f2 | 41 | # define MAX_PACKET_SIZE_EP6 64 |
Helmut64 | 0:a3ea811f80f2 | 42 | #endif |
Helmut64 | 0:a3ea811f80f2 | 43 | |
Helmut64 | 0:a3ea811f80f2 | 44 | /* Generic endpoints - intended to be portable accross devices */ |
Helmut64 | 0:a3ea811f80f2 | 45 | /* and be suitable for simple USB devices. */ |
Helmut64 | 0:a3ea811f80f2 | 46 | |
Helmut64 | 0:a3ea811f80f2 | 47 | /* Bulk endpoints */ |
Helmut64 | 0:a3ea811f80f2 | 48 | #define EPBULK_OUT EP2OUT |
Helmut64 | 0:a3ea811f80f2 | 49 | #define EPBULK_IN EP2IN |
Helmut64 | 0:a3ea811f80f2 | 50 | #define EPBULK_OUT_callback EP2_OUT_callback |
Helmut64 | 0:a3ea811f80f2 | 51 | #define EPBULK_IN_callback EP2_IN_callback |
Helmut64 | 0:a3ea811f80f2 | 52 | /* Interrupt endpoints */ |
Helmut64 | 0:a3ea811f80f2 | 53 | #define EPINT_OUT EP1OUT |
Helmut64 | 0:a3ea811f80f2 | 54 | #define EPINT_IN EP1IN |
Helmut64 | 0:a3ea811f80f2 | 55 | #define EPINT_OUT_callback EP1_OUT_callback |
Helmut64 | 0:a3ea811f80f2 | 56 | #define EPINT_IN_callback EP1_IN_callback |
Helmut64 | 0:a3ea811f80f2 | 57 | /* Isochronous endpoints */ |
Helmut64 | 0:a3ea811f80f2 | 58 | #define EPISO_OUT EP3OUT |
Helmut64 | 0:a3ea811f80f2 | 59 | #define EPISO_IN EP3IN |
Helmut64 | 0:a3ea811f80f2 | 60 | #define EPISO_OUT_callback EP3_OUT_callback |
Helmut64 | 0:a3ea811f80f2 | 61 | #define EPISO_IN_callback EP3_IN_callback |
Helmut64 | 0:a3ea811f80f2 | 62 | |
Helmut64 | 0:a3ea811f80f2 | 63 | #define MAX_PACKET_SIZE_EPBULK 64 |
Helmut64 | 0:a3ea811f80f2 | 64 | #define MAX_PACKET_SIZE_EPINT 64 |
Helmut64 | 0:a3ea811f80f2 | 65 | #define MAX_PACKET_SIZE_EPISO 1023 |