|
16 | 16 | #define NU_MAX_EPX_BUFSIZE 4096
|
17 | 17 | #define NU_EP2EPL(ep) ((ep) >> 1)
|
18 | 18 | #define NU_EP2EPH(ep) (((ep) >> 1) - 1)
|
19 |
| -#define NU_EPX2EP(ep) ((ep == CEP) ? EP0OUT : ((ep) - EPA + EP1OUT)) |
20 |
| -#define NU_EPL2EPH(ep) ((ep) - 1) |
21 |
| -#define NU_EPH2EPL(ep) ((ep) + 1) |
| 19 | +#define NU_EPX2EP(ep) ((ep == CEP) ? EP0OUT : ((ep) - EPA + EP1OUT)) |
| 20 | +#define NU_EPL2EPH(ep) ((ep) - 1) |
| 21 | +#define NU_EPH2EPL(ep) ((ep) + 1) |
22 | 22 | #define NU_EP_DIR_Pos 0
|
23 | 23 | #define NU_EP_DIR_Msk (1 << NU_EP_DIR_Pos)
|
24 | 24 | #define NU_EP_DIR_OUT 0
|
|
39 | 39 | #define EP2IN (5)
|
40 | 40 | #define EP3OUT (6)
|
41 | 41 | #define EP3IN (7)
|
42 |
| -#define EP4OUT (8) |
43 |
| -#define EP4IN (9) |
| 42 | +#define EP4OUT (8) |
| 43 | +#define EP4IN (9) |
44 | 44 | #define EP5OUT (10)
|
45 | 45 | #define EP5IN (11)
|
46 | 46 | #define EP6OUT (12)
|
47 | 47 | #define EP6IN (13)
|
48 | 48 |
|
49 | 49 | /* Maximum Packet sizes */
|
50 |
| -#define MAX_PACKET_SIZE_EP0 64 |
51 |
| -#define MAX_PACKET_SIZE_EP1 64 |
52 |
| -#define MAX_PACKET_SIZE_EP2 64 |
53 |
| -#define MAX_PACKET_SIZE_EP3 0x60 |
54 |
| -#define MAX_PACKET_SIZE_EP4 64 |
55 |
| -#define MAX_PACKET_SIZE_EP5 64 |
56 |
| -#define MAX_PACKET_SIZE_EP6 64 |
57 |
| -#define MAX_PACKET_SIZE_EP7 64 |
58 |
| -#define MAX_PACKET_SIZE_EP8 64 |
59 |
| -#define MAX_PACKET_SIZE_EP9 64 |
60 |
| -#define MAX_PACKET_SIZE_EP10 64 |
61 |
| -#define MAX_PACKET_SIZE_EP11 64 |
| 50 | +#define MAX_PACKET_SIZE_EP0 64 |
| 51 | +#define MAX_PACKET_SIZE_EP1 64 |
| 52 | +#define MAX_PACKET_SIZE_EP2 64 |
| 53 | +#define MAX_PACKET_SIZE_EP3 0x60 |
| 54 | +#define MAX_PACKET_SIZE_EP4 64 |
| 55 | +#define MAX_PACKET_SIZE_EP5 64 |
| 56 | +#define MAX_PACKET_SIZE_EP6 64 |
| 57 | +#define MAX_PACKET_SIZE_EP7 64 |
| 58 | +#define MAX_PACKET_SIZE_EP8 64 |
| 59 | +#define MAX_PACKET_SIZE_EP9 64 |
| 60 | +#define MAX_PACKET_SIZE_EP10 64 |
| 61 | +#define MAX_PACKET_SIZE_EP11 64 |
62 | 62 |
|
63 | 63 | /* Generic endpoints - intended to be portable accross devices */
|
64 | 64 | /* and be suitable for simple USB devices. */
|
|
83 | 83 | #define MAX_PACKET_SIZE_EPINT 64
|
84 | 84 | #define MAX_PACKET_SIZE_EPISO 1023
|
85 | 85 |
|
86 |
| -#define USBD_GET_EP_MAX_PAYLOAD(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EPAMPS + (uint32_t)((ep)*0x28)))) |
87 |
| -#define USBD_GET_EP_DATA_COUNT(ep) ((*((__IO uint32_t *) ((uint32_t)&USBD->EPADATCNT + (uint32_t)((ep)*0x28)))) & 0xFFFFF) |
88 |
| -#define USBD_SET_EP_SHORT_PACKET(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EPARSPCTL + (uint32_t)((ep)*0x28))) = (*((__IO uint32_t *) ((uint32_t)&USBD->EPARSPCTL + (uint32_t)((ep)*0x28)))) & 0x10 | 0x40) |
89 |
| -#define USBD_GET_EP_INT_EN(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EPAINTEN + (uint32_t)((ep)*0x28)))) |
| 86 | +#define USBD_GET_EP_MAX_PAYLOAD(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EPAMPS + (uint32_t)((ep)*0x28)))) |
| 87 | +#define USBD_GET_EP_DATA_COUNT(ep) ((*((__IO uint32_t *) ((uint32_t)&USBD->EPADATCNT + (uint32_t)((ep)*0x28)))) & 0xFFFFF) |
| 88 | +#define USBD_SET_EP_SHORT_PACKET(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EPARSPCTL + (uint32_t)((ep)*0x28))) = (*((__IO uint32_t *) ((uint32_t)&USBD->EPARSPCTL + (uint32_t)((ep)*0x28)))) & 0x10 | 0x40) |
| 89 | +#define USBD_GET_EP_INT_EN(ep) (*((__IO uint32_t *) ((uint32_t)&USBD->EPAINTEN + (uint32_t)((ep)*0x28)))) |
0 commit comments