20#if defined(USB_OTG_HS) || defined(USB_OTG_FS)
26 Direction dir,
size_t hw_buffer_offset,
size_t hw_buffer_size,
31 void Close()
override;
32 ErrorCode
Transfer(
size_t size)
override;
34 ErrorCode
Stall()
override;
39 PCD_HandleTypeDef* hpcd_;
41 size_t last_transfer_size_ = 0;
43#if defined(USB_OTG_FS) || defined(USB_OTG_HS)
44 size_t fifo_size_ = 0;
47 size_t hw_buffer_size_ = 0;
49 stm32_usb_dev_id_t id_;
51#if defined(USB_OTG_HS)
52#if defined(USB_OTG_HS_MAX_IN_ENDPOINTS)
53 static constexpr uint8_t EP_OTG_HS_MAX_SIZE =
54 LibXR::max(USB_OTG_HS_MAX_IN_ENDPOINTS, USB_OTG_HS_MAX_OUT_ENDPOINTS);
56 static constexpr uint8_t EP_OTG_HS_MAX_SIZE = 9;
59 static inline STM32Endpoint* map_otg_hs_[EP_OTG_HS_MAX_SIZE][2] = {};
62#if defined(USB_OTG_FS)
63#if defined(USB_OTG_FS_MAX_IN_ENDPOINTS)
64 static constexpr uint8_t EP_OTG_FS_MAX_SIZE =
65 LibXR::max(USB_OTG_FS_MAX_IN_ENDPOINTS, USB_OTG_FS_MAX_OUT_ENDPOINTS);
66#elif defined(STM32H7) || defined(STM32N6)
67 static constexpr uint8_t EP_OTG_FS_MAX_SIZE = 9;
69 static constexpr uint8_t EP_OTG_FS_MAX_SIZE = 6;
71 static inline STM32Endpoint* map_otg_fs_[EP_OTG_FS_MAX_SIZE][2] = {};
75 static constexpr uint8_t EP_OTG_FS_MAX_SIZE = 8;
76 static inline STM32Endpoint* map_fs_[EP_OTG_FS_MAX_SIZE][2] = {};