simplify read/write 16-bit packet

This commit is contained in:
hathach
2024-07-31 20:53:42 +07:00
parent 7d9b399466
commit 332f75cd44
3 changed files with 85 additions and 111 deletions

View File

@@ -54,29 +54,6 @@
#endif
#define FSDEV_PMA_SIZE (512u)
#if 1
// volatile 32-bit aligned
#define _vaa32 volatile TU_ATTR_ALIGNED(4)
typedef struct {
_vaa32 uint16_t EP0R; // 00: USB Endpoint 0 register
_vaa32 uint16_t EP1R; // 04: USB Endpoint 1 register
_vaa32 uint16_t EP2R; // 08: USB Endpoint 2 register
_vaa32 uint16_t EP3R; // 0C: USB Endpoint 3 register
_vaa32 uint16_t EP4R; // 10: USB Endpoint 4 register
_vaa32 uint16_t EP5R; // 14: USB Endpoint 5 register
_vaa32 uint16_t EP6R; // 18: USB Endpoint 6 register
_vaa32 uint16_t EP7R; // 1C: USB Endpoint 7 register
_vaa32 uint16_t RESERVED7[16]; // Reserved
_vaa32 uint16_t CNTR; // 40: Control register
_vaa32 uint16_t ISTR; // 44: Interrupt status register
_vaa32 uint16_t FNR; // 48: Frame number register
_vaa32 uint16_t DADDR; // 4C: Device address register
_vaa32 uint16_t BTABLE; // 50: Buffer Table address register
} USB_TypeDef;
#endif
#define FSDEV_REG_BASE 0x40005C00UL
#define USB_BASE (APB1PERIPH_BASE + 0x00005C00UL) /*!< USB_IP Peripheral Registers base address */