Functions | |
void | usb_device_task_init (void) |
This function initializes the USB device controller. | |
void | usb_start_device (void) |
This function initializes the USB device controller. | |
void | usb_device_task (void) |
Entry point of the USB device mamagement. |
|
This function initializes the USB device controller. This function enables the USB controller and init the USB interrupts. The aim is to allow the USB connection detection in order to send the appropriate USB event to the operating mode manager.
Definition at line 73 of file usb_device_task.c. References Usb_disable, Usb_enable, Usb_enable_vbus_interrupt, and Usb_select_device. Referenced by usb_task_init(). 00074 { 00075 Enable_interrupt(); 00076 Usb_disable(); 00077 Usb_enable(); 00078 Usb_select_device(); 00079 Usb_enable_vbus_interrupt(); 00080 Enable_interrupt(); 00081 00082 }
|
|
This function initializes the USB device controller. This function enables the USB controller and init the USB interrupts. The aim is to allow the USB connection detection in order to send the appropriate USB event to the operating mode manager. Start device function is executed once VBUS connection has been detected either by the VBUS change interrupt either by the VBUS high level
Definition at line 97 of file usb_device_task.c. References FALSE, Usb_attach, usb_connected, Usb_enable_reset_interrupt, Usb_enable_suspend_interrupt, usb_init_device(), Usb_unfreeze_clock, and Wait_pll_ready. Referenced by usb_general_interrupt(). 00098 { 00099 Pll_start_auto(); 00100 Wait_pll_ready(); 00101 Usb_unfreeze_clock(); 00102 Usb_enable_suspend_interrupt(); 00103 Usb_enable_reset_interrupt(); 00104 usb_init_device(); // configure the USB controller EP0 00105 Usb_attach(); 00106 usb_connected = FALSE; 00107 }
Here is the call graph for this function: ![]() |
|
Entry point of the USB device mamagement. This function is the entry point of the USB management. Each USB event is checked here in order to launch the appropriate action. If a Setup request occurs on the Default Control Endpoint, the usb_process_request() function is call in the usb_standard_request.c file
Definition at line 119 of file usb_device_task.c. References EP_CONTROL, EVT_USB_POWERED, EVT_USB_RESET, FALSE, Is_usb_event, Is_usb_receive_setup, Is_usb_vbus_high, TRUE, Usb_ack_event, Usb_attach, usb_configuration_nb, usb_connected, Usb_enable_reset_interrupt, usb_process_request(), Usb_reset_endpoint, Usb_select_endpoint, Usb_send_event, and Usb_vbus_on_action. Referenced by usb_task(). 00120 { 00121 if (Is_usb_vbus_high()&& usb_connected==FALSE) 00122 { 00123 usb_connected = TRUE; 00124 Usb_vbus_on_action(); 00125 Usb_send_event(EVT_USB_POWERED); 00126 Usb_enable_reset_interrupt(); 00127 Usb_attach(); 00128 } 00129 00130 if(Is_usb_event(EVT_USB_RESET)) 00131 { 00132 Usb_ack_event(EVT_USB_RESET); 00133 Usb_reset_endpoint(0); 00134 usb_configuration_nb=0; 00135 } 00136 00137 // Here connection to the device enumeration process 00138 Usb_select_endpoint(EP_CONTROL); 00139 if (Is_usb_receive_setup()) 00140 { 00141 usb_process_request(); 00142 } 00143 }
Here is the call graph for this function: ![]() |