ATMEL: usb_host_enum.h File Reference

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# usb_host_enum.h File Reference

`#include "modules/usb/usb_task.h"`

Include dependency graph for usb_host_enum.h:

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

Go to the source code of this file.

## Data Structures

struct | S_usb_setup_data
| Usb Setup Data. More...
struct | S_usb_endpoint
struct | S_usb_interface
struct | S_usb_device
struct | S_usb_tree

## Defines

#define | T_DESC_OFFSET U8
| Optimize descriptor offset index according to data_stage[] size.
#define | MAX_EP_PER_INTERFACE 4
#define | REQUEST_TYPE_POS 0
#define | REQUEST_POS 1
#define | VALUE_HIGH_POS 2
#define | VALUE_LOW_POS 3
#define | INDEX_HIGH_POS 4
#define | INDEX_LOW_POS 5
#define | LENGTH_HIGH_POS 6
#define | LENGTH_LOW_POS 7
#define | UNCOMPLETE_READ_POS 8
#define | DATA_ADDR_HIGH_POS 9
#define | DATA_ADDR_LOW_POS 10
#define | CONTROL_GOOD 0
#define | CONTROL_DATA_TOGGLE 0x01
#define | CONTROL_DATA_PID 0x02
#define | CONTROL_PID 0x04
#define | CONTROL_TIMEOUT 0x08
#define | CONTROL_CRC16 0x10
#define | CONTROL_STALL 0x20
#define | CONTROL_NO_DEVICE 0x40
| Set of defines for offset in data stage.
#define | OFFSET_FIELD_MAXPACKETSIZE 7
#define | OFFSET_FIELD_MSB_VID 9
#define | OFFSET_FIELD_LSB_VID 8
#define | OFFSET_FIELD_MSB_PID 11
#define | OFFSET_FIELD_LSB_PID 10
#define | OFFSET_DESCRIPTOR_LENGHT 0
#define | OFFSET_FIELD_DESCRIPTOR_TYPE 1
#define | OFFSET_FIELD_TOTAL_LENGHT 2
#define | OFFSET_FIELD_BMATTRIBUTES 7
#define | OFFSET_FIELD_MAXPOWER 8
#define | OFFSET_FIELD_NB_INTERFACE 4
| OFFSET for INTERFACE DESCRIPTORS.
#define | OFFSET_FIELD_CLASS 5
#define | OFFSET_FIELD_SUB_CLASS 6
#define | OFFSET_FIELD_PROTOCOL 7
#define | OFFSET_FIELD_INTERFACE_NB 2
#define | OFFSET_FIELD_ALT 3
#define | OFFSET_FIELS_NB_OF_EP 4
#define | OFFSET_FIELD_EP_ADDR 2
#define | OFFSET_FIELD_EP_TYPE 3
#define | OFFSET_FIELD_EP_SIZE 4
#define | OFFSET_FIELD_EP_INTERVAL 6
#define | HOST_FALSE 0
#define | HOST_TRUE 1
#define | host_clear_endpoint_feature(ep)
| host_clear_endpoint_feature
#define | host_get_configuration()
| host_get_configuration
#define | host_set_configuration(cfg_nb)
| host_set_configuration
#define | host_set_interface(interface_nb, alt_setting)
| host_set_interface
#define | host_get_device_descriptor_uncomplete()
| host_get_device_descriptor_uncomplete
#define | host_get_device_descriptor()
| host_get_device_descriptor
#define | host_get_configuration_descriptor()
| host_get_configuration_descriptor
#define | host_get_descriptor_uncomplete()
#define | host_set_address(addr)
| host_set_address
#define | host_set_feature_remote_wakeup()
| host_set_feature_remote_wakeup
#define | host_ms_get_max_lun()
| host_ms_get_max_lun
#define | Get_VID() (usb_tree.device[selected_device].vid)
| Get_VID.
#define | Get_PID() (usb_tree.device[selected_device].pid)
| Get_PID.
#define | Get_ep0_size() (usb_tree.device[selected_device].ep_ctrl_size)
| Get_ep0_size.
#define | Get_maxpower() (usb_tree.device[selected_device].maxpower)
| Get_maxpower.
#define | Get_class(s_interface) (usb_tree.device[selected_device].interface[s_interface].class)
#define | Get_subclass(s_interface) (usb_tree.device[selected_device].interface[s_interface].subclass)
#define | Get_protocol(s_interface) (usb_tree.device[selected_device].interface[s_interface].protocol)
#define | Get_ep_addr(s_interface, n_ep) (usb_tree.device[selected_device].interface[s_interface].ep[n_ep].ep_addr)
#define | Get_nb_ep(s_interface) (usb_tree.device[selected_device].interface[s_interface].nb_ep)
#define | Get_alts_s(s_interface) (usb_tree.device[selected_device].interface[s_interface].altset_nb)
#define | Get_interface_number(s_interface) (usb_tree.device[selected_device].interface[s_interface].interface_nb)
#define | Get_nb_supported_interface() (usb_tree.device[selected_device].nb_interface)
#define | Is_device_self_powered() ((usb_tree.device[selected_device].bmattributes & USB_CONFIG_ATTRIBUTES_SELFPOWERED) ? TRUE : FALSE)
#define | Get_nb_device() (usb_tree.nb_device)
#define | Is_device_supports_remote_wakeup() ((usb_tree.device[selected_device].bmattributes & USB_CONFIG_ATTRIBUTES_REMOTEWAKEUP) ? TRUE : FALSE)
#define | Host_select_device(i) (host_select_device(i))
#define | Host_get_nb_device() ((U16)(usb_tree.nb_device))

## Functions

U8 | host_send_control (U8 *)
| host_send_control.
U8 | host_check_VID_PID (void)
| host_check_VID_PID
U8 | host_check_class (void)
| host_check_class
U8 | host_auto_configure_endpoint ()
U8 | get_interface_descriptor_offset (U8 interface, U8 alt)
| get_interface_descriptor_offset
U8 | host_get_hwd_pipe_nb (U8 ep_addr)
void | init_usb_tree (void)
| init_usb_tree
void | remove_device_entry (U8 device_index)
| remove_device_entry
void | host_select_device (U8 i)
void | freeze_user_periodic_pipe (void)
void | unfreeze_user_periodic_pipe (void)

## Variables

U8 | user_periodic_pipe
S_usb_tree | usb_tree
| The main structure that represents the usb tree connected to the host controller.
S_usb_setup_data | usb_request
| For control requests management over pipe 0.
U8 | data_stage [SIZEOF_DATA_STAGE]
| Public : U8 data_stage[SIZEOF_DATA_STAGE]; Internal RAM buffer for USB data stage content This buffer is required to setup host enumeration process Its contains the device descriptors received.
U8 | device_status
U8 | selected_device
U8 | ctrl_pipe_size

## Detailed Description

USB host enumeration process header file This file contains the USB pipe 0 management routines corresponding to the standard enumeration process (refer to chapter 9 of the USB specification.

- Compiler: IAR EWAVR and GNU GCC for AVR
- Supported devices: AT90USB1287, AT90USB1286, AT90USB647, AT90USB646

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file usb_host_enum.h.

## Define Documentation

#define T_DESC_OFFSET U8

Optimize descriptor offset index according to data_stage[] size.

Definition at line 63 of file usb_host_enum.h.

Referenced by get_interface_descriptor_offset(), host_auto_configure_endpoint(), and host_check_class().

#define MAX_EP_PER_INTERFACE 4

Definition at line 69 of file usb_host_enum.h.