Skip to content

Commit

Permalink
bugfix(ch32-hs-dcd): fix ch32 DATAx managment and long packet transmi…
Browse files Browse the repository at this point in the history
…ssion
  • Loading branch information
Krasutski committed Dec 30, 2023
1 parent ae364b1 commit c6e3fc0
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 204 deletions.
21 changes: 10 additions & 11 deletions src/portable/wch/ch32_usbhs_reg.h
Expand Up @@ -72,12 +72,16 @@
#define USBHS_ISO_ACT_FLAG (1 << 6)

// INT_ST
#define USBHS_INT_ST_OFFSET 0x0B
#define USBHS_DEV_UIS_IS_NAK (1 << 7)
#define USBHS_DEV_UIS_TOG_OK (1 << 6)
#define MASK_UIS_TOKEN (3 << 4)
#define MASK_UIS_ENDP (0x0F)
#define MASK_UIS_H_RES (0x0F)
#define USBHS_INT_ST_OFFSET 0x0B
#define USBHS_DEV_UIS_IS_NAK (1 << 7)
#define USBHS_DEV_UIS_TOG_OK (1 << 6)
#define MASK_UIS_TOKEN (3 << 4)
#define USBHS_TOKEN_PID_OUT (0 << 4)
#define USBHS_TOKEN_PID_SOF (1 << 4)
#define USBHS_TOKEN_PID_IN (2 << 4)
#define USBHS_TOKEN_PID_SETUP (3 << 4)
#define MASK_UIS_ENDP (0x0F)
#define MASK_UIS_H_RES (0x0F)

#define USBHS_TOGGLE_OK (0x40)
#define USBHS_HOST_RES (0x0f)
Expand Down Expand Up @@ -340,10 +344,5 @@
#define USBHS_UH_T_TOG_AUTO (1 << 5)
#define USBHS_UH_T_DATA_NO (1 << 6)

// 00: OUT, 01:SOF, 10:IN, 11:SETUP
#define PID_OUT 0
#define PID_SOF 1
#define PID_IN 2
#define PID_SETUP 3

#endif

0 comments on commit c6e3fc0

Please sign in to comment.