35#ifdef __PROJECT_MIKROSDK_MIKROE__
37#include "interrupts.h"
40#define DWC2_REG_BASE 0x50000000UL
45 { .reg_base = DWC2_REG_BASE, .irqnum = 86, .ep_count = DWC2_EP_MAX, .ep_fifo_size = 1280 }
48extern uint32_t SystemCoreClock;
53#define ECLIC_INTERRUPT_ENABLE_BASE 0xD2001001UL
56static inline void __eclic_enable_interrupt (uint32_t irq) {
57 *(
volatile uint8_t*)(ECLIC_INTERRUPT_ENABLE_BASE + (irq * 4)) = 1;
61static inline void __eclic_disable_interrupt (uint32_t irq){
62 *(
volatile uint8_t*)(ECLIC_INTERRUPT_ENABLE_BASE + (irq * 4)) = 0;
66static inline void dwc2_dcd_int_enable(uint8_t rhport)
68 #ifdef __PROJECT_MIKROSDK_MIKROE__
70 interrupt_enable(_dwc2_controller[rhport].irqnum);
72 __eclic_enable_interrupt(_dwc2_controller[rhport].irqnum);
77static inline void dwc2_dcd_int_disable (uint8_t rhport)
79 #ifdef __PROJECT_MIKROSDK_MIKROE__
81 interrupt_disable(_dwc2_controller[rhport].irqnum);
83 __eclic_disable_interrupt(_dwc2_controller[rhport].irqnum);
87static inline void dwc2_remote_wakeup_delay(
void)
90 uint32_t count = SystemCoreClock / 1000;
91 while ( count-- ) __asm
volatile (
"nop");
95static inline void dwc2_phy_init(
dwc2_regs_t * dwc2, uint8_t hs_phy_type)
104static inline void dwc2_phy_update(
dwc2_regs_t * dwc2, uint8_t hs_phy_type)
Definition dwc2_type.h:28
Definition dwc2_type.h:191