Xmega Application Note


usb_task.h File Reference


Detailed Description

This file contains the function declarations.

Application note:
AVR1907: Xplain Evaluation Board
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
Revision
3122
Date
2010-01-13 13:26:22 +0100 (on, 13 jan 2010)

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.

This graph shows which files directly or indirectly include this file:

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 Documentation

#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

Definition at line 53 of file usb_task.h.

Referenced by ISR(), and usb_device_task().

#define EVT_USB_RESET   8

Definition at line 60 of file usb_task.h.

Referenced by ISR(), and usb_device_task().

#define EVT_USB_RESUME   7

Definition at line 59 of file usb_task.h.

Referenced by ISR().

#define EVT_USB_SUSPEND   5

Definition at line 57 of file usb_task.h.

Referenced by ISR().

#define EVT_USB_UNPOWERED   2

Definition at line 54 of file usb_task.h.

Referenced by ISR().

#define EVT_USB_WAKE_UP   6

Definition at line 58 of file usb_task.h.

Referenced by ISR().

 
#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 (  )     ((g_usb_event & (1<<x)) ? false: true)

Definition at line 75 of file usb_task.h.

#define Is_usb_event (  )     ((g_usb_event & (1<<x)) ? true : false)

Definition at line 74 of file usb_task.h.

Referenced by usb_device_task().

#define Usb_ack_event (  )     (g_usb_event &= ~(1<<x))

Definition at line 72 of file usb_task.h.

Referenced by usb_device_task().

 
#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 (  )     (g_usb_event |= (1<<x))

Definition at line 71 of file usb_task.h.

Referenced by ISR(), and usb_device_task().


Function Documentation

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:


Variable Documentation

volatile uint16_t g_usb_event

Definition at line 59 of file usb_task.c.

volatile uint8_t private_sof_counter

@DOC_TITLE@
Generated on Mon Jan 18 09:26:15 2010 for AVR1907 Xplain USB Gateway by doxygen 1.5.5