USB_Host_Shield_2.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Typedefs
Usb.h File Reference
#include <inttypes.h>
#include <assert.h>
#include "avrpins.h"
#include "max3421e.h"
#include "usbhost.h"
#include "usb_ch9.h"
#include "address.h"
#include <WProgram.h>
#include "printhex.h"
#include "hexdump.h"
#include "message.h"
Include dependency graph for Usb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  USBDeviceConfig
 
struct  SETUP_PKT
 
class  USBReadParser
 
class  USB
 

Macros

#define USB_METHODS_INLINE
 
#define USBTRACE(s)   (Serial.print((s)))
 
#define USBTRACE2(s, r)   (Serial.print((s)), Serial.println((r),HEX))
 
#define bmREQ_GET_DESCR   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE
 
#define bmREQ_SET   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE
 
#define bmREQ_CL_GET_INTF   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define USB_CLASS_USE_CLASS_INFO   0x00
 
#define USB_CLASS_AUDIO   0x01
 
#define USB_CLASS_COM_AND_CDC_CTRL   0x02
 
#define USB_CLASS_HID   0x03
 
#define USB_CLASS_PHYSICAL   0x05
 
#define USB_CLASS_IMAGE   0x06
 
#define USB_CLASS_PRINTER   0x07
 
#define USB_CLASS_MASS_STORAGE   0x08
 
#define USB_CLASS_HUB   0x09
 
#define USB_CLASS_CDC_DATA   0x0a
 
#define USB_CLASS_SMART_CARD   0x0b
 
#define USB_CLASS_CONTENT_SECURITY   0x0d
 
#define USB_CLASS_VIDEO   0x0e
 
#define USB_CLASS_PERSONAL_HEALTH   0x0f
 
#define USB_CLASS_DIAGNOSTIC_DEVICE   0xdc
 
#define USB_CLASS_WIRELESS_CTRL   0xe0
 
#define USB_CLASS_MISC   0xef
 
#define USB_CLASS_APP_SPECIFIC   0xfe
 
#define USB_CLASS_VENDOR_SPECIFIC   0xff
 
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED   0xD1
 
#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE   0xD2
 
#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS   0xD3
 
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL   0xD4
 
#define USB_ERROR_HUB_ADDRESS_OVERFLOW   0xD5
 
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL   0xD6
 
#define USB_ERROR_EPINFO_IS_NULL   0xD7
 
#define USB_ERROR_INVALID_ARGUMENT   0xD8
 
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE   0xD9
 
#define USB_ERROR_INVALID_MAX_PKT_SIZE   0xDA
 
#define USB_ERROR_EP_NOT_FOUND_IN_TBL   0xDB
 
#define USB_ERROR_TRANSFER_TIMEOUT   0xFF
 
#define USB_XFER_TIMEOUT   5000
 
#define USB_RETRY_LIMIT   3
 
#define USB_SETTLE_DELAY   200
 
#define USB_NUMDEVICES   16
 
#define HUB_PORT_RESET_DELAY   20
 
#define USB_STATE_MASK   0xf0
 
#define USB_STATE_DETACHED   0x10
 
#define USB_DETACHED_SUBSTATE_INITIALIZE   0x11
 
#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE   0x12
 
#define USB_DETACHED_SUBSTATE_ILLEGAL   0x13
 
#define USB_ATTACHED_SUBSTATE_SETTLE   0x20
 
#define USB_ATTACHED_SUBSTATE_RESET_DEVICE   0x30
 
#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE   0x40
 
#define USB_ATTACHED_SUBSTATE_WAIT_SOF   0x50
 
#define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE   0x60
 
#define USB_STATE_ADDRESSING   0x70
 
#define USB_STATE_CONFIGURING   0x80
 
#define USB_STATE_RUNNING   0x90
 
#define USB_STATE_ERROR   0xa0
 

Typedefs

typedef MAX3421e< P10, P9 > MAX3421E
 
typedef struct SETUP_PKTPSETUP_PKT
 

Macro Definition Documentation

#define HUB_PORT_RESET_DELAY   20
#define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE   0x60
#define USB_ATTACHED_SUBSTATE_RESET_DEVICE   0x30
#define USB_ATTACHED_SUBSTATE_SETTLE   0x20
#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE   0x40
#define USB_ATTACHED_SUBSTATE_WAIT_SOF   0x50
#define USB_CLASS_APP_SPECIFIC   0xfe
#define USB_CLASS_AUDIO   0x01
#define USB_CLASS_CDC_DATA   0x0a
#define USB_CLASS_COM_AND_CDC_CTRL   0x02
#define USB_CLASS_CONTENT_SECURITY   0x0d
#define USB_CLASS_DIAGNOSTIC_DEVICE   0xdc
#define USB_CLASS_HID   0x03
#define USB_CLASS_HUB   0x09
#define USB_CLASS_IMAGE   0x06
#define USB_CLASS_MASS_STORAGE   0x08
#define USB_CLASS_MISC   0xef
#define USB_CLASS_PERSONAL_HEALTH   0x0f
#define USB_CLASS_PHYSICAL   0x05
#define USB_CLASS_PRINTER   0x07
#define USB_CLASS_SMART_CARD   0x0b
#define USB_CLASS_USE_CLASS_INFO   0x00
#define USB_CLASS_VENDOR_SPECIFIC   0xff
#define USB_CLASS_VIDEO   0x0e
#define USB_CLASS_WIRELESS_CTRL   0xe0
#define USB_DETACHED_SUBSTATE_ILLEGAL   0x13
#define USB_DETACHED_SUBSTATE_INITIALIZE   0x11
#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE   0x12
#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE   0xD2
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED   0xD1
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL   0xD6
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE   0xD9
#define USB_ERROR_EP_NOT_FOUND_IN_TBL   0xDB
#define USB_ERROR_EPINFO_IS_NULL   0xD7
#define USB_ERROR_HUB_ADDRESS_OVERFLOW   0xD5
#define USB_ERROR_INVALID_ARGUMENT   0xD8
#define USB_ERROR_INVALID_MAX_PKT_SIZE   0xDA
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL   0xD4
#define USB_ERROR_TRANSFER_TIMEOUT   0xFF
#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS   0xD3
#define USB_METHODS_INLINE
#define USB_NUMDEVICES   16
#define USB_RETRY_LIMIT   3
#define USB_SETTLE_DELAY   200
#define USB_STATE_ADDRESSING   0x70
#define USB_STATE_CONFIGURING   0x80
#define USB_STATE_DETACHED   0x10
#define USB_STATE_ERROR   0xa0
#define USB_STATE_MASK   0xf0
#define USB_STATE_RUNNING   0x90
#define USB_XFER_TIMEOUT   5000
#define USBTRACE (   s)    (Serial.print((s)))
#define USBTRACE2 (   s,
 
)    (Serial.print((s)), Serial.println((r),HEX))

Typedef Documentation

typedef MAX3421e<P10, P9> MAX3421E
typedef struct SETUP_PKT * PSETUP_PKT