27#ifndef TUSB_MUSB_MAX32_H_
28#define TUSB_MUSB_MAX32_H_
34#include "mxc_device.h"
35#include "usbhs_regs.h"
37#define MUSB_CFG_SHARED_FIFO 1
38#define MUSB_CFG_DYNAMIC_FIFO 0
43#define USBHS_M31_CLOCK_RECOVERY
59 #ifdef NVIC_GetEnableIRQ
60 return NVIC_GetEnableIRQ(
musb_irqs[rhport]);
62 uint32_t IRQn = (uint32_t)
musb_irqs[rhport];
63 return ((NVIC->ISER[IRQn >> 5UL] & (1UL << (IRQn & 0x1FUL))) != 0UL) ? 1UL : 0UL;
72 mxc_usbhs_regs_t* hs_phy = MXC_USBHS;
73 uint32_t mxm_int, mxm_int_en, mxm_is;
76 mxm_int = hs_phy->mxm_int;
77 mxm_int_en = hs_phy->mxm_int_en;
78 mxm_is = mxm_int & mxm_int_en;
79 hs_phy->mxm_int = mxm_is;
81 if (mxm_is & MXC_F_USBHS_MXM_INT_NOVBUS) {
88 mxc_usbhs_regs_t* hs_phy = MXC_USBHS;
91 hs_phy->mxm_int_en |= MXC_F_USBHS_MXM_INT_EN_NOVBUS;
96 hs_phy->mxm_suspend = 0;
99 hs_phy->m31_phy_xcfgi_31_0 = (0x1 << 3) | (0x1 << 11);
100 hs_phy->m31_phy_xcfgi_63_32 = 0;
101 hs_phy->m31_phy_xcfgi_95_64 = 0x1 << (72 - 64);
102 hs_phy->m31_phy_xcfgi_127_96 = 0;
104 #ifdef USBHS_M31_CLOCK_RECOVERY
105 hs_phy->m31_phy_noncry_rstb = 1;
106 hs_phy->m31_phy_noncry_en = 1;
107 hs_phy->m31_phy_outclksel = 0;
108 hs_phy->m31_phy_coreclkin = 0;
109 hs_phy->m31_phy_xtlsel = 2;
111 hs_phy->m31_phy_noncry_rstb = 0;
112 hs_phy->m31_phy_noncry_en = 0;
113 hs_phy->m31_phy_outclksel = 1;
114 hs_phy->m31_phy_coreclkin = 1;
115 hs_phy->m31_phy_xtlsel = 3;
117 hs_phy->m31_phy_pll_en = 1;
118 hs_phy->m31_phy_oscouten = 1;
121 hs_phy->m31_phy_ponrst = 0;
122 hs_phy->m31_phy_ponrst = 1;
static TU_ATTR_ALWAYS_INLINE void dcd_event_bus_signal(uint8_t rhport, dcd_eventid_t eid, bool in_isr)
static TU_ATTR_ALWAYS_INLINE void musb_dcd_int_disable(uint8_t rhport)
static void musb_dcd_phy_init(uint8_t rhport)
static void musb_dcd_int_handler_enter(uint8_t rhport)
static const IRQn_Type musb_irqs[]
static TU_ATTR_ALWAYS_INLINE void musb_dcd_int_clear(uint8_t rhport)
static TU_ATTR_ALWAYS_INLINE void musb_dcd_int_enable(uint8_t rhport)
static TU_ATTR_ALWAYS_INLINE unsigned musb_dcd_get_int_enable(uint8_t rhport)
const uintptr_t MUSB_BASES[]