moving esp32s2 to dwc2, abstract dwc2_set_turnaround()
This commit is contained in:
@@ -28,14 +28,18 @@
|
||||
#ifndef DWC2_GD32_H_
|
||||
#define DWC2_GD32_H_
|
||||
|
||||
// for remote wakeup delay
|
||||
#define __NOP() __asm volatile ("nop")
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// These numbers are the same for the whole GD32VF103 family.
|
||||
#define DWC2_REG_BASE 0x50000000UL
|
||||
#define EP_MAX 4
|
||||
#define EP_FIFO_SIZE 1280
|
||||
#define RHPORT_IRQn 86
|
||||
#define DWC2_REG_BASE 0x50000000UL
|
||||
#define DWC2_EP_MAX 4
|
||||
#define DWC2_EP_FIFO_SIZE 1280
|
||||
#define RHPORT_IRQn 86
|
||||
|
||||
extern uint32_t SystemCoreClock;
|
||||
|
||||
// The GD32VF103 is a RISC-V MCU, which implements the ECLIC Core-Local
|
||||
// Interrupt Controller by Nuclei. It is nearly API compatible to the
|
||||
@@ -66,4 +70,25 @@ static inline void dcd_dwc2_int_disable (uint8_t rhport)
|
||||
__eclic_disable_interrupt(RHPORT_IRQn);
|
||||
}
|
||||
|
||||
TU_ATTR_ALWAYS_INLINE
|
||||
static inline void dwc2_remote_wakeup_delay(void)
|
||||
{
|
||||
// try to delay for 1 ms
|
||||
uint32_t count = SystemCoreClock / 1000;
|
||||
while ( count-- ) __asm volatile ("nop");
|
||||
}
|
||||
|
||||
static inline void dwc2_set_turnaround(dwc2_core_t * core, tusb_speed_t speed)
|
||||
{
|
||||
(void) core;
|
||||
(void) speed;
|
||||
|
||||
// keep the reset value
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* DWC2_GD32_H_ */
|
||||
|
||||
Reference in New Issue
Block a user