#include "config.h"
#include "conf\conf_usb.h"
#include "usb_task.h"
#include "lib_mcu\usb\usb_drv.h"
#include "modules\usb\usb_enum.h"
#include "intrins.h"
Go to the source code of this file.
Functions | |
| void | usb_task_init (void) |
| This function initializes the USB the associated variables. | |
| void | usb_start_device (void) |
| This function initializes the USB device controller. | |
| void | usb_task (void) |
| Entry point of the USB mamnagement. | |
| void | usb_interrupt (void) |
| USB interrupt process. | |
Variables | |
| volatile bit | usb_connected |
| Public : (bit) usb_connected usb_connected is set to TRUE when VBUS has been detected usb_connected is set to FALSE otherwise /. | |
| U8 xdata | sof_counter |
| volatile U8 data | toggle_next_time |
| _MEM_TYPE_SLOW_ U8 | usb_configuration_nb |
| volatile bit | usb_continuous_mode |
| U8 | send_free = 0 |
| S_hid_set_control | SetControlBytes |
Please read file license.txt for copyright notice.
The USB task checks the income of new requests from the USB Host. When a Setup request occurs, this task will launch the processing of this setup contained in the usb_enum.c file. Other class specific requests are also processed in this file. This file manages all the USB events: Suspend / Resume / Reset / Start Of Frame / Wake Up / Vbus events
Definition in file usb_task.c.
|
|
This function initializes the USB the associated variables. 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 68 of file usb_task.c. References FALSE, Set_page_usb, sof_counter, toggle_next_time, TRUE, usb_connected, usb_continuous_mode, Usb_enable, and usb_start_device().
|
|
|
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 95 of file usb_task.c. References Enable_interrupt, Enable_usb_interrupt, Set_page_usb, U16, Usb_ack_suspend, Usb_attach, Usb_detach, Usb_enable_reset_interrupt, Usb_enable_resume_interrupt, Usb_enable_sof_interrupt, Usb_enable_suspend_interrupt, Usb_enable_wake_up_interrupt, usb_generate_clock(), usb_init_device(), Usb_set_speed, and Usb_unfreeze_clock. Referenced by usb_task_init().
|
|
|
Entry point of the USB mamnagement. 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_enum.c file If a new USB mass storage Command Block Wrapper (CBW) occurs, this one will be decoded and the SCSI command will be taken in charge by the scsi decoder.
this part of the code can be modify following the application end of modification Definition at line 133 of file usb_task.c. References Disable_ale, Enable_interrupt, EP_CONTROL, EP_HID_IN, FALSE, Is_usb_in_ready, Is_usb_receive_setup, Led_all_off, Pll_stop, send_free, Set_page_usb, SetControlBytes, TRUE, S_hid_set_control::type, Usb_ack_in_ready, usb_connected, usb_continuous_mode, usb_process_request(), Usb_select_endpoint, and Usb_suspend_action.
|
|
|
USB interrupt process. This function is called each time a USB interrupt occurs. The following USB events are taken in charge:
Definition at line 199 of file usb_task.c. References Enable_ale, FALSE, Is_usb_reset, Is_usb_sof, Is_usb_suspend, Is_usb_wake_up, Pll_enable, sof_counter, Switch_ale, TRUE, Usb_ack_reset, Usb_ack_sof, Usb_ack_suspend, Usb_ack_wake_up, usb_connected, usb_continuous_mode, Usb_enable_sof_interrupt, Usb_enable_suspend_interrupt, Usb_enable_wake_up_interrupt, usb_enum_var_init(), Usb_freeze_clock, and Usb_unfreeze_clock.
|
|
|
Public : (bit) usb_connected usb_connected is set to TRUE when VBUS has been detected usb_connected is set to FALSE otherwise /.
Definition at line 42 of file usb_task.c. Referenced by usb_enum_var_init(), usb_interrupt(), usb_task(), and usb_task_init(). |
|
|
Definition at line 43 of file usb_task.c. Referenced by usb_interrupt(), and usb_task_init(). |
|
|
Definition at line 44 of file usb_task.c. Referenced by usb_task_init(). |
|
|
Definition at line 46 of file usb_task.c. |
|
|
Definition at line 48 of file usb_task.c. Referenced by usb_interrupt(), usb_task(), and usb_task_init(). |
|
|
Definition at line 49 of file usb_task.c. Referenced by usb_task(), usb_user_endpoint_init(), and usb_write_continuous(). |
|
|
Definition at line 51 of file usb_task.c. Referenced by usb_task(), and usb_user_read_request(). |
1.3.7