libxr
1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
stm32_usb.hpp
1
#pragma once
2
3
#include "double_buffer.hpp"
4
#include "main.h"
5
6
#undef USB
7
8
#include "usb/core/ep_pool.hpp"
9
#include "usb/device/dev_core.hpp"
10
11
#if defined(HAL_PCD_MODULE_ENABLED)
12
16
typedef
enum : uint8_t
17
{
18
#if (defined(USB_BASE))
19
STM32_USB_FS_DEV,
20
#endif
21
#if (defined(USB_OTG_FS))
22
STM32_USB_OTG_FS,
23
#endif
24
#if (defined(USB_OTG_HS))
25
STM32_USB_OTG_HS,
26
#endif
27
STM32_USB_DEV_ID_NUM
28
} stm32_usb_dev_id_t;
29
30
static
inline
bool
STM32USBUsesDma(PCD_HandleTypeDef* hpcd)
31
{
32
#if defined(USB_OTG_FS) || defined(USB_OTG_HS)
33
return
hpcd->Init.dma_enable == 1U;
34
#else
35
UNUSED(hpcd);
36
return
false
;
37
#endif
38
}
39
40
#endif
driver
st
stm32_usb.hpp
Generated by
1.12.0