Skip to content

Commit 110deed

Browse files
authored
Merge pull request #3514 from OpenNuvoton/nuvoton_usb
[NUC472/M453] Remove Tab in USB HAL
2 parents 3019688 + 614a451 commit 110deed

File tree

4 files changed

+539
-537
lines changed

4 files changed

+539
-537
lines changed

features/unsupported/USBDevice/USBDevice/USBEndpoints_M453.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#define NU_MAX_EPX_BUFSIZE 4096
1717
#define NU_EP2EPL(ep) ((ep) >> 1)
1818
#define NU_EP2EPH(ep) (((ep) >> 1) + 1)
19-
#define NU_EPL2EPH(ep) ((ep) + 1)
20-
#define NU_EPH2EPL(ep) ((ep) - 1)
19+
#define NU_EPL2EPH(ep) ((ep) + 1)
20+
#define NU_EPH2EPL(ep) ((ep) - 1)
2121
#define NU_EP_DIR_Pos 0
2222
#define NU_EP_DIR_Msk (1 << NU_EP_DIR_Pos)
2323
#define NU_EP_DIR_OUT 0
@@ -37,22 +37,22 @@
3737
#define EP2IN (5)
3838
#define EP3OUT (6)
3939
#define EP3IN (7)
40-
#define EP4OUT (8)
41-
#define EP4IN (9)
40+
#define EP4OUT (8)
41+
#define EP4IN (9)
4242
#define EP5OUT (10)
4343
#define EP5IN (11)
4444
#define EP6OUT (12)
4545
#define EP6IN (13)
4646

4747
/* Maximum Packet sizes */
48-
#define MAX_PACKET_SIZE_EP0 64
49-
#define MAX_PACKET_SIZE_EP1 64
50-
#define MAX_PACKET_SIZE_EP2 64
51-
#define MAX_PACKET_SIZE_EP3 0x60
52-
#define MAX_PACKET_SIZE_EP4 64
53-
#define MAX_PACKET_SIZE_EP5 64
54-
#define MAX_PACKET_SIZE_EP6 64
55-
#define MAX_PACKET_SIZE_EP7 64
48+
#define MAX_PACKET_SIZE_EP0 64
49+
#define MAX_PACKET_SIZE_EP1 64
50+
#define MAX_PACKET_SIZE_EP2 64
51+
#define MAX_PACKET_SIZE_EP3 0x60
52+
#define MAX_PACKET_SIZE_EP4 64
53+
#define MAX_PACKET_SIZE_EP5 64
54+
#define MAX_PACKET_SIZE_EP6 64
55+
#define MAX_PACKET_SIZE_EP7 64
5656

5757
/* Generic endpoints - intended to be portable accross devices */
5858
/* and be suitable for simple USB devices. */

features/unsupported/USBDevice/USBDevice/USBEndpoints_NUC472.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#define NU_MAX_EPX_BUFSIZE 4096
1717
#define NU_EP2EPL(ep) ((ep) >> 1)
1818
#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)
2222
#define NU_EP_DIR_Pos 0
2323
#define NU_EP_DIR_Msk (1 << NU_EP_DIR_Pos)
2424
#define NU_EP_DIR_OUT 0
@@ -39,26 +39,26 @@
3939
#define EP2IN (5)
4040
#define EP3OUT (6)
4141
#define EP3IN (7)
42-
#define EP4OUT (8)
43-
#define EP4IN (9)
42+
#define EP4OUT (8)
43+
#define EP4IN (9)
4444
#define EP5OUT (10)
4545
#define EP5IN (11)
4646
#define EP6OUT (12)
4747
#define EP6IN (13)
4848

4949
/* 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
6262

6363
/* Generic endpoints - intended to be portable accross devices */
6464
/* and be suitable for simple USB devices. */
@@ -83,7 +83,7 @@
8383
#define MAX_PACKET_SIZE_EPINT 64
8484
#define MAX_PACKET_SIZE_EPISO 1023
8585

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

Comments
 (0)