void ep_init() { U8 i; // Initialize USB clock to use 48Mhz Oscillator //SI32_USB_A_verify_clock_is_running(SI32_USB_0); // disable and clear all endpoints for (i=0; i<MAX_EPS; i++) { ep_disable(i); ep_cfg_clear(i); } // reset all the endpoints //UERST = 0x7F; //UERST = 0; // configure the control endpoint first since that one is needed for enumeration ep_config( EP_CTRL, XFER_CONTROL, DIR_OUT, MAX_PACKET_SZ ); NVIC_EnableIRQ( USB0_IRQn ); // set the rx setup interrupt to received the enumeration interrupts //ep_select(EP_CTRL); }
void ep_init() { U8 i; // disable and clear all endpoints for (i=0; i<MAX_EPS; i++) { ep_select(i); ep_disable(i); ep_cfg_clear(i); } // reset all the endpoints UERST = 0x7F; UERST = 0; // configure the control endpoint first since that one is needed for enumeration ep_config(EP_CTRL, CONTROL, DIR_OUT, MAX_PACKET_SZ); // set the rx setup interrupt to received the enumeration interrupts ep_select(EP_CTRL); }