17#if defined(USB_OTG_HS) || defined(USB_OTG_FS)
23 Direction dir,
size_t hw_buffer_offset,
size_t hw_buffer_size,
28 void Close()
override;
29 ErrorCode
Transfer(
size_t size)
override;
31 ErrorCode
Stall()
override;
36 PCD_HandleTypeDef* hpcd_;
37#if defined(USB_OTG_FS) || defined(USB_OTG_HS)
38 size_t fifo_size_ = 0;
41 size_t hw_buffer_size_ = 0;
42 bool double_hw_buffer_ =
false;
44 stm32_usb_dev_id_t id_;
46#if defined(USB_OTG_HS)
47#if defined(USB_OTG_HS_MAX_IN_ENDPOINTS)
48 static constexpr uint8_t EP_OTG_HS_MAX_SIZE =
49 LibXR::max(USB_OTG_HS_MAX_IN_ENDPOINTS, USB_OTG_HS_MAX_OUT_ENDPOINTS);
51 static constexpr uint8_t EP_OTG_HS_MAX_SIZE = 9;
54 static inline STM32Endpoint* map_hs_[EP_OTG_HS_MAX_SIZE][2] = {};
57#if defined(USB_OTG_FS)
58#if defined(USB_OTG_FS_MAX_IN_ENDPOINTS)
59 static constexpr uint8_t EP_OTG_FS_MAX_SIZE =
60 LibXR::max(USB_OTG_FS_MAX_IN_ENDPOINTS, USB_OTG_FS_MAX_OUT_ENDPOINTS);
61#elif defined(STM32H7) || defined(STM32N6)
62 static constexpr uint8_t EP_OTG_FS_MAX_SIZE = 9;
64 static constexpr uint8_t EP_OTG_FS_MAX_SIZE = 6;
66 static inline STM32Endpoint* map_fs_[EP_OTG_FS_MAX_SIZE][2] = {};
70 static constexpr uint8_t EP_OTG_FS_MAX_SIZE = 8;
71 static inline STM32Endpoint* map_otg_fs_[EP_OTG_FS_MAX_SIZE][2] = {};