usb_host_task.h File Reference

#include "modules/usb/host_chap9/usb_host_hub.h"

Include dependency graph for usb_host_task.h:

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

Go to the source code of this file.

Data Structures

struct  S_pipe_int

Defines

#define PIPE_GOOD   0
#define PIPE_DATA_TOGGLE   0x01
#define PIPE_DATA_PID   0x02
#define PIPE_PID   0x04
#define PIPE_TIMEOUT   0x08
#define PIPE_CRC16   0x10
#define PIPE_STALL   0x20
#define PIPE_NAK_TIMEOUT   0x40
#define PIPE_DELAY_TIMEOUT   0x80
#define Is_host_ready()   ((device_state==DEVICE_READY) ? TRUE : FALSE)
#define Is_host_not_ready()   ((device_state==DEVICE_READY) ? FALSE :TRUE)
 Returns true when the high application should not perform request to the device.
#define Is_host_suspended()   (((device_state==DEVICE_WAIT_RESUME) ||(device_state==DEVICE_SUSPENDED)) ? TRUE : FALSE)
 Check if host controller is in suspend mode.
#define Is_host_not_suspended()   (((device_state==DEVICE_WAIT_RESUME) ||(device_state==DEVICE_SUSPENDED)) ? FALSE : TRUE)
 Check if host controller is not suspend mode.
#define Is_host_unattached()   ((device_state==DEVICE_UNATTACHED) ? TRUE : FALSE)
 Check if there is an attached device connected to the host.
#define Is_host_attached()   ((device_state>=DEVICE_UNATTACHED) ? TRUE : FALSE)
 Check if there is an attached device connected to the host.
#define Host_request_suspend()   (device_state=DEVICE_SUSPENDED)
 This function should be called to make the host controller enter USB suspend mode.
#define Host_request_resume()   (request_resume=TRUE)
 This function should be called to request the host controller to resume the USB bus.
#define Host_ack_request_resume()   (request_resume=FALSE)
 Private ack for software event.
#define Host_force_enumeration()   (force_enumeration=TRUE, device_state=DEVICE_ATTACHED, init_usb_tree())
 Force reset and (re)enumeration of the connected device.
#define Is_host_request_resume()   ((request_resume==TRUE) ? TRUE : FALSE)
 Private check for resume sequence.
#define Is_new_device_connection_event()   (new_device_connected ? TRUE : FALSE)
 Returns true when a new device is enumerated.
#define Is_device_disconnection_event()   ((device_state==DEVICE_DISCONNECTED_ACK || device_state==DEVICE_DISCONNECTED || f_hub_port_disconnect) ? TRUE : FALSE)
 Returns true when the device disconnects from the host.
#define Host_stop_pipe_interrupt(i)
 Stop all interrupt attached to a pipe.
#define DEVICE_UNATTACHED   0
#define DEVICE_ATTACHED   1
#define DEVICE_POWERED   2
#define DEVICE_DEFAULT   3
#define DEVICE_ADDRESSED   4
#define DEVICE_CONFIGURED   5
#define DEVICE_READY   6
#define DEVICE_ERROR   7
#define DEVICE_SUSPENDED   8
#define DEVICE_WAIT_RESUME   9
#define DEVICE_DISCONNECTED   10
#define DEVICE_DISCONNECTED_ACK   11
#define Host_set_device_supported()   (device_status |= 0x01)
#define Host_clear_device_supported()   (device_status &= ~0x01)
#define Is_host_device_supported()   (device_status & 0x01)
#define Host_set_device_ready()   (device_status |= 0x02)
#define Host_clear_device_ready()   (device_status &= ~0x02)
#define Is_host_device_ready()   (device_status & 0x02)
#define Host_set_configured()   (device_status |= 0x04)
#define Host_clear_configured()   (device_status &= ~0x04)
#define Is_host_configured()   (device_status & 0x04)
#define Host_clear_device_status()   (device_status = 0x00)

Functions

void usb_host_task_init (void)
void usb_host_task (void)
U8 host_send_data (U8 pipe, U16 nb_data, U8 *buf)
U8 host_get_data (U8 pipe, U16 *nb_data, U8 *buf)
U8 host_get_data_interrupt (U8 pipe, U16 nb_data, U8 *buf, void(*handle)(U8 status, U16 nb_byte))
U8 host_send_data_interrupt (U8 pipe, U16 nb_data, U8 *buf, void(*handle)(U8 status, U16 nb_byte))
void reset_it_pipe_str (void)
U8 is_any_interrupt_pipe_active (void)

Variables

U8 device_state
 Public : U8 device_state Its value represent the current state of the device connected to the usb host controller Value can be:
  • DEVICE_ATTACHED
  • DEVICE_POWERED
  • DEVICE_SUSPENDED
  • DEVICE_DEFAULT
  • DEVICE_BASE_ADDRESSED
  • DEVICE_CONFIGURED
  • DEVICE_ERROR
  • DEVICE_UNATTACHED
  • DEVICE_READY
  • DEVICE_WAIT_RESUME
  • DEVICE_DISCONNECTED
  • DEVICE_DISCONNECTED_ACK /.

U8 request_resume
U8 new_device_connected
U8 force_enumeration


Detailed Description

This file contains the function declarations for usb host task functions - Compiler: IAR EWAVR and GNU GCC for AVR

Definition in file usb_host_task.h.


Define Documentation

#define PIPE_GOOD   0

Definition at line 72 of file usb_host_task.h.

Referenced by call_back_template_1(), call_back_template_2(), host_get_data(), host_send_data(), and usb_pipe_interrupt().

#define PIPE_DATA_TOGGLE   0x01

Definition at line 73 of file usb_host_task.h.

#define PIPE_DATA_PID   0x02

Definition at line 74 of file usb_host_task.h.

#define PIPE_PID   0x04

Definition at line 75 of file usb_host_task.h.

#define PIPE_TIMEOUT   0x08

Definition at line 76 of file usb_host_task.h.

Referenced by host_send_data().

#define PIPE_CRC16   0x10

Definition at line 77 of file usb_host_task.h.

#define PIPE_STALL   0x20

Definition at line 78 of file usb_host_task.h.

Referenced by host_get_data(), host_send_data(), and usb_pipe_interrupt().

#define PIPE_NAK_TIMEOUT   0x40

Definition at line 79 of file usb_host_task.h.

Referenced by host_get_data(), host_send_data(), and usb_pipe_interrupt().

#define PIPE_DELAY_TIMEOUT   0x80

Definition at line 80 of file usb_host_task.h.

Referenced by host_get_data(), host_send_data(), and usb_general_interrupt().


Generated on Mon Sep 14 13:24:12 2009 for ATMEL by  doxygen 1.5.3