Xmega Application Note | |||||
Copyright (c) 2010, Atmel Corporation All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file usb_task.h.
Go to the source code of this file.
Defines | |
#define | EVT_HOST_DISCONNECTION 11 |
#define | EVT_HOST_HWUP 10 |
#define | EVT_HOST_SOF 9 |
#define | EVT_USB_DEVICE_FUNCTION 3 |
#define | EVT_USB_HOST_FUNCTION 4 |
#define | EVT_USB_POWERED 1 |
#define | EVT_USB_RESET 8 |
#define | EVT_USB_RESUME 7 |
#define | EVT_USB_SUSPEND 5 |
#define | EVT_USB_UNPOWERED 2 |
#define | EVT_USB_WAKE_UP 6 |
#define | Is_host_emergency_exit() (Is_usb_event(EVT_HOST_DISCONNECTION) || Is_usb_event(EVT_USB_DEVICE_FUNCTION)) |
#define | Is_not_usb_event(x) ((g_usb_event & (1<<x)) ? false: true) |
#define | Is_usb_event(x) ((g_usb_event & (1<<x)) ? true : false) |
#define | Usb_ack_event(x) (g_usb_event &= ~(1<<x)) |
#define | Usb_clear_all_event() (g_usb_event = 0) |
#define | USB_MODE_DEVICE 0x02 |
#define | USB_MODE_HOST 0x01 |
#define | USB_MODE_UNDEFINED 0x00 |
#define | Usb_send_event(x) (g_usb_event |= (1<<x)) |
Functions | |
void | usb_task (void) |
Entry point of the USB mamnagement. | |
void | usb_task_init (void) |
This function initializes the USB proces. | |
Variables | |
volatile uint16_t | g_usb_event |
volatile uint8_t | private_sof_counter |
#define EVT_HOST_DISCONNECTION 11 |
Definition at line 63 of file usb_task.h.
#define EVT_HOST_HWUP 10 |
Definition at line 62 of file usb_task.h.
#define EVT_HOST_SOF 9 |
Definition at line 61 of file usb_task.h.
#define EVT_USB_DEVICE_FUNCTION 3 |
Definition at line 55 of file usb_task.h.
#define EVT_USB_HOST_FUNCTION 4 |
Definition at line 56 of file usb_task.h.
#define EVT_USB_POWERED 1 |
#define EVT_USB_RESET 8 |
#define EVT_USB_RESUME 7 |
#define EVT_USB_SUSPEND 5 |
#define EVT_USB_UNPOWERED 2 |
#define EVT_USB_WAKE_UP 6 |
#define Is_host_emergency_exit | ( | ) | (Is_usb_event(EVT_HOST_DISCONNECTION) || Is_usb_event(EVT_USB_DEVICE_FUNCTION)) |
Definition at line 76 of file usb_task.h.
#define Is_not_usb_event | ( | x | ) | ((g_usb_event & (1<<x)) ? false: true) |
Definition at line 75 of file usb_task.h.
#define Is_usb_event | ( | x | ) | ((g_usb_event & (1<<x)) ? true : false) |
#define Usb_ack_event | ( | x | ) | (g_usb_event &= ~(1<<x)) |
#define Usb_clear_all_event | ( | ) | (g_usb_event = 0) |
Definition at line 73 of file usb_task.h.
#define USB_MODE_DEVICE 0x02 |
Definition at line 67 of file usb_task.h.
#define USB_MODE_HOST 0x01 |
Definition at line 66 of file usb_task.h.
#define USB_MODE_UNDEFINED 0x00 |
Definition at line 65 of file usb_task.h.
#define Usb_send_event | ( | x | ) | (g_usb_event |= (1<<x)) |
void usb_task | ( | void | ) |
Entry point of the USB mamnagement.
Depending on the USB mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the coresponding usb management function.
Definition at line 82 of file usb_task.c.
References usb_device_task().
Referenced by main().
00083 { 00084 usb_device_task(); 00085 00086 }
void usb_task_init | ( | void | ) |
This function initializes the USB proces.
Depending on the mode supported (HOST/DEVICE/DUAL_ROLE) the function calls the coresponding usb mode initialization function
Definition at line 70 of file usb_task.c.
References usb_device_task_init(), and Usb_force_device_mode.
Referenced by main().
00071 { 00072 Usb_force_device_mode(); 00073 usb_device_task_init(); 00074 }
volatile uint16_t g_usb_event |
Definition at line 59 of file usb_task.c.
volatile uint8_t private_sof_counter |
Generated on Mon Jan 18 09:26:15 2010 for AVR1907 Xplain USB Gateway by ![]() |