usb_device_task.h File Reference

,vThis file contains the function declarations for USB device task More...

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

Go to the source code of this file.

Defines

#define B_IDLE   0
 Definitions of B-Device states.
#define B_SRP_INIT   1
#define B_PERIPHERAL   2
#define B_WAIT_ACON   3
#define B_HOST   4
#define B_END_HNP_SUSPEND   5
#define Start_session_with_srp()   (otg_device_sessions |= 0x01)
 Is the current session a result of a SRP ?
#define End_session_with_srp()   (otg_device_sessions &= ~0x01)
#define Is_session_started_with_srp()   (((otg_device_sessions&0x01) != 0) ? TRUE : FALSE)
#define Srp_sent_and_waiting_answer()   (otg_device_sessions |= 0x02)
 Has a SRP been sent, and waiting for an answer.
#define Ack_srp_sent_and_answer()   (otg_device_sessions &= ~0x02)
#define Is_srp_sent_and_waiting_answer()   (((otg_device_sessions&0x02) != 0) ? TRUE : FALSE)
#define TB_SRP_FAIL_MIN   0x0A28
 Tb_Srp_Fail must be between 5 and 6 sec. With an interrupt routine executed each 2ms, its value becomes 2500 (used:5.2sec).
#define Init_tb_srp_counter()   (otg_tb_srp_cpt = 0)
#define Is_tb_srp_counter_overflow()   ((otg_tb_srp_cpt > TB_SRP_FAIL_MIN) ? TRUE : FALSE)

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.

Variables

U8 otg_device_sessions
 OTG B-Device SRP protocole specific states or events.
U8 otg_b_device_state
 Public : (U8) otg_b_device_state; Store the current state of the B-Device.
U8 sof_seen_in_session
 Public : (U8) sof_seen_in_session; Indicates if a SOF has been received during the current session /.
U16 otg_tb_srp_cpt
 Public : (U16) otg_tb_srp_cpt; Counter used to signal a SRP fail condition (SRP fails if Tb_Srp_Fail elapsed).


Detailed Description

,vThis file contains the function declarations for USB device task

Copyright (c) 2004 Atmel.

Please read file license.txt for copyright notice.

Version:
1.2 at90usb128-otg-dual_role-toggle-1_0_0
Id
usb_device_task.h,v 1.2 2007/02/13 10:17:53 arobert Exp
Todo:
Bug:

Definition in file usb_device_task.h.


Generated on Mon Feb 19 09:32:00 2007 for Atmel by  doxygen 1.5.1-p1