Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
USB task entry point module

Modules

 USB software Events Management
 Macros to manage USB events detected under interrupt.
 
 Standard requests defines
 

Macros

#define USB_HIGH_SPEED_SUPPORT   false
 
#define USB_MODE_DEVICE   0x01
 
#define USB_MODE_HOST   0x02
 
#define USB_MODE_UNDEFINED   0x00
 

Functions

U32 host_get_timeout (void)
 
void usb_task (void)
 Entry point of the USB mamnagement. More...
 
void usb_task_init (void)
 This function initializes the USB process. More...
 

Variables

volatile U16 g_usb_event
 Public: uint16_t g_usb_event usb_connected is used to store USB events detected upon USB general interrupt subroutine Its value is managed by the following macros (See usb_task.h file) Usb_send_event(x) Usb_ack_event(x) Is_usb_event(x) Usb_clear_all_event() More...
 
volatile U8 g_usb_mode
 Public: uint8_t g_usb_mode Used in dual-role application (both device/host) to store the current mode the USB controller is operating. More...
 
volatile U32 private_sof_counter
 Private: uint8_t private_sof_counter Incremented by host SOF interrupt subroutime This counter is used to detect time-out in host requests. More...
 

#define USB_HIGH_SPEED_SUPPORT   false
#define USB_MODE_DEVICE   0x01
#define USB_MODE_HOST   0x02
#define USB_MODE_UNDEFINED   0x00

Referenced by usb_task().

U32 host_get_timeout ( void  )
void usb_task ( void  )

Entry point of the USB mamnagement.

Depending on the mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the corresponding USB management function

Depending on the USB mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the coresponding USB management function.

Entry point of the USB mamnagement.

Depending on the USB mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the corresponding USB management function.

References Enable_global_interrupt, g_old_usb_mode, g_usb_mode, Is_usb_id_device, private_sof_counter, usb_device_task(), usb_device_task_init(), Usb_enable_id_interrupt, usb_host_task(), usb_host_task_init(), USB_MODE_DEVICE, USB_MODE_HOST, and USB_MODE_UNDEFINED.

Referenced by main(), and usb_task_init().

void usb_task_init ( void  )

This function initializes the USB process.

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. Depending on the mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the corresponding USB mode initialization function

Depending on the mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the coresponding USB mode initialization function

Depending on the mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the corresponding USB mode initialization function

References configTSK_USB_NAME, configTSK_USB_PRIORITY, configTSK_USB_STACK_SIZE, NULL, usb_task(), vSemaphoreCreateBinary, and xTaskCreate.

Referenced by b_usbsys_start(), and main().

volatile U16 g_usb_event

Public: uint16_t g_usb_event usb_connected is used to store USB events detected upon USB general interrupt subroutine Its value is managed by the following macros (See usb_task.h file) Usb_send_event(x) Usb_ack_event(x) Is_usb_event(x) Usb_clear_all_event()

Public: uint16_t g_usb_event usb_connected is used to store USB events detected upon USB general interrupt subroutine Its value is managed by the following macros (See usb_task.h file) Usb_send_event(x) Usb_ack_event(x) Is_usb_event(x) Usb_clear_all_event()

volatile U8 g_usb_mode

Public: uint8_t g_usb_mode Used in dual-role application (both device/host) to store the current mode the USB controller is operating.

Public: uint8_t g_usb_mode Used in dual-role application (both device/host) to store the current mode the USB controller is operating.

Referenced by ai_hid_class_get_device_status(), ai_usb_ms_get_device_status(), if(), usb_general_interrupt(), and usb_task().

volatile U32 private_sof_counter

Private: uint8_t private_sof_counter Incremented by host SOF interrupt subroutime This counter is used to detect time-out in host requests.

It must not be modified by the user applicative tasks.

Private: uint8_t private_sof_counter Incremented by host SOF interrupt subroutime This counter is used to detect time-out in host requests.

It must not be modified by the user applicative tasks.

Referenced by host_get_data(), host_get_data_interrupt(), host_get_timeout(), host_send_data(), host_send_data_interrupt(), host_transfer_control(), usb_general_interrupt(), usb_pipe_interrupt(), and usb_task().