works!

Dependencies:   mbed

Committer:
mjoun
Date:
Fri Feb 21 20:40:56 2020 +0000
Revision:
1:6e512faaa17c
works

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mjoun 1:6e512faaa17c 1
mjoun 1:6e512faaa17c 2 #ifndef TARGET_EFM32HG_STK3400
mjoun 1:6e512faaa17c 3 # define NUMBER_OF_LOGICAL_ENDPOINTS (6)
mjoun 1:6e512faaa17c 4 #else
mjoun 1:6e512faaa17c 5 # define NUMBER_OF_LOGICAL_ENDPOINTS (3)
mjoun 1:6e512faaa17c 6 #endif
mjoun 1:6e512faaa17c 7
mjoun 1:6e512faaa17c 8 #define NUMBER_OF_PHYSICAL_ENDPOINTS (NUMBER_OF_LOGICAL_ENDPOINTS * 2)
mjoun 1:6e512faaa17c 9 #define NUMBER_OF_ENDPOINTS (NUMBER_OF_PHYSICAL_ENDPOINTS + 2) /* Includes EP0 */
mjoun 1:6e512faaa17c 10
mjoun 1:6e512faaa17c 11 #define EP0OUT (0)
mjoun 1:6e512faaa17c 12 #define EP0IN (1)
mjoun 1:6e512faaa17c 13 #define EP1OUT (2)
mjoun 1:6e512faaa17c 14 #define EP1IN (3)
mjoun 1:6e512faaa17c 15 #define EP2OUT (4)
mjoun 1:6e512faaa17c 16 #define EP2IN (5)
mjoun 1:6e512faaa17c 17 #define EP3OUT (6)
mjoun 1:6e512faaa17c 18 #define EP3IN (7)
mjoun 1:6e512faaa17c 19 #ifndef TARGET_EFM32HG_STK3400
mjoun 1:6e512faaa17c 20 # define EP4OUT (8)
mjoun 1:6e512faaa17c 21 # define EP4IN (9)
mjoun 1:6e512faaa17c 22 # define EP5OUT (10)
mjoun 1:6e512faaa17c 23 # define EP5IN (11)
mjoun 1:6e512faaa17c 24 # define EP6OUT (12)
mjoun 1:6e512faaa17c 25 # define EP6IN (13)
mjoun 1:6e512faaa17c 26 #endif
mjoun 1:6e512faaa17c 27
mjoun 1:6e512faaa17c 28 #define USB_EP_TO_INDEX(ep) (ep)
mjoun 1:6e512faaa17c 29 #define USB_EP_TO_ADDR(ep) (((ep)>>1) | (((ep) & 1 ) ? 0x80 : 0x00))
mjoun 1:6e512faaa17c 30 #define USB_ADDR_TO_EP(ep) (((ep)<<1) | (((ep) & 0x80) ? 0x01 : 0x00))
mjoun 1:6e512faaa17c 31
mjoun 1:6e512faaa17c 32 /* Maximum Packet sizes */
mjoun 1:6e512faaa17c 33
mjoun 1:6e512faaa17c 34 #define MAX_PACKET_SIZE_EP0 64
mjoun 1:6e512faaa17c 35 #define MAX_PACKET_SIZE_EP1 64
mjoun 1:6e512faaa17c 36 #define MAX_PACKET_SIZE_EP2 64
mjoun 1:6e512faaa17c 37 #define MAX_PACKET_SIZE_EP3 64
mjoun 1:6e512faaa17c 38 #ifndef TARGET_EFM32HG_STK3400
mjoun 1:6e512faaa17c 39 # define MAX_PACKET_SIZE_EP4 64
mjoun 1:6e512faaa17c 40 # define MAX_PACKET_SIZE_EP5 64
mjoun 1:6e512faaa17c 41 # define MAX_PACKET_SIZE_EP6 64
mjoun 1:6e512faaa17c 42 #endif
mjoun 1:6e512faaa17c 43
mjoun 1:6e512faaa17c 44 /* Generic endpoints - intended to be portable accross devices */
mjoun 1:6e512faaa17c 45 /* and be suitable for simple USB devices. */
mjoun 1:6e512faaa17c 46
mjoun 1:6e512faaa17c 47 /* Bulk endpoints */
mjoun 1:6e512faaa17c 48 #define EPBULK_OUT EP2OUT
mjoun 1:6e512faaa17c 49 #define EPBULK_IN EP2IN
mjoun 1:6e512faaa17c 50 #define EPBULK_OUT_callback EP2_OUT_callback
mjoun 1:6e512faaa17c 51 #define EPBULK_IN_callback EP2_IN_callback
mjoun 1:6e512faaa17c 52 /* Interrupt endpoints */
mjoun 1:6e512faaa17c 53 #define EPINT_OUT EP1OUT
mjoun 1:6e512faaa17c 54 #define EPINT_IN EP1IN
mjoun 1:6e512faaa17c 55 #define EPINT_OUT_callback EP1_OUT_callback
mjoun 1:6e512faaa17c 56 #define EPINT_IN_callback EP1_IN_callback
mjoun 1:6e512faaa17c 57 /* Isochronous endpoints */
mjoun 1:6e512faaa17c 58 #define EPISO_OUT EP3OUT
mjoun 1:6e512faaa17c 59 #define EPISO_IN EP3IN
mjoun 1:6e512faaa17c 60 #define EPISO_OUT_callback EP3_OUT_callback
mjoun 1:6e512faaa17c 61 #define EPISO_IN_callback EP3_IN_callback
mjoun 1:6e512faaa17c 62
mjoun 1:6e512faaa17c 63 #define MAX_PACKET_SIZE_EPBULK 64
mjoun 1:6e512faaa17c 64 #define MAX_PACKET_SIZE_EPINT 64
mjoun 1:6e512faaa17c 65 #define MAX_PACKET_SIZE_EPISO 1023