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 "Arduino.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 USBTRACE(s)   (Notify(PSTR(s), 0x80))
 
#define USBTRACE2(s, r)   (Notify(PSTR(s), 0x80), D_PrintHex((r), 0x80), Notify(PSTR("\r\n"), 0x80))
 
#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_CONFIG_REQUIRES_ADDITIONAL_RESET   0xE0
 
#define USB_ERROR_FailGetDevDescr   0xE1
 
#define USB_ERROR_FailSetDevTblEntry   0xE2
 
#define USB_ERROR_FailGetConfDescr   0xE3
 
#define USB_ERROR_TRANSFER_TIMEOUT   0xFF
 
#define USB_XFER_TIMEOUT   10000
 
#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_WAIT_RESET   0x51
 
#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 USBTRACE (   s)    (Notify(PSTR(s), 0x80))

Definition at line 62 of file Usb.h.

#define USBTRACE2 (   s,
 
)    (Notify(PSTR(s), 0x80), D_PrintHex((r), 0x80), Notify(PSTR("\r\n"), 0x80))

Definition at line 63 of file Usb.h.

Definition at line 68 of file Usb.h.

Definition at line 69 of file Usb.h.

Definition at line 70 of file Usb.h.

#define USB_CLASS_USE_CLASS_INFO   0x00

Definition at line 77 of file Usb.h.

#define USB_CLASS_AUDIO   0x01

Definition at line 78 of file Usb.h.

#define USB_CLASS_COM_AND_CDC_CTRL   0x02

Definition at line 79 of file Usb.h.

#define USB_CLASS_HID   0x03

Definition at line 80 of file Usb.h.

#define USB_CLASS_PHYSICAL   0x05

Definition at line 81 of file Usb.h.

#define USB_CLASS_IMAGE   0x06

Definition at line 82 of file Usb.h.

#define USB_CLASS_PRINTER   0x07

Definition at line 83 of file Usb.h.

#define USB_CLASS_MASS_STORAGE   0x08

Definition at line 84 of file Usb.h.

#define USB_CLASS_HUB   0x09

Definition at line 85 of file Usb.h.

#define USB_CLASS_CDC_DATA   0x0a

Definition at line 86 of file Usb.h.

#define USB_CLASS_SMART_CARD   0x0b

Definition at line 87 of file Usb.h.

#define USB_CLASS_CONTENT_SECURITY   0x0d

Definition at line 88 of file Usb.h.

#define USB_CLASS_VIDEO   0x0e

Definition at line 89 of file Usb.h.

#define USB_CLASS_PERSONAL_HEALTH   0x0f

Definition at line 90 of file Usb.h.

#define USB_CLASS_DIAGNOSTIC_DEVICE   0xdc

Definition at line 91 of file Usb.h.

#define USB_CLASS_WIRELESS_CTRL   0xe0

Definition at line 92 of file Usb.h.

#define USB_CLASS_MISC   0xef

Definition at line 93 of file Usb.h.

#define USB_CLASS_APP_SPECIFIC   0xfe

Definition at line 94 of file Usb.h.

#define USB_CLASS_VENDOR_SPECIFIC   0xff

Definition at line 95 of file Usb.h.

#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED   0xD1

Definition at line 98 of file Usb.h.

#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE   0xD2

Definition at line 99 of file Usb.h.

#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS   0xD3

Definition at line 100 of file Usb.h.

#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL   0xD4

Definition at line 101 of file Usb.h.

#define USB_ERROR_HUB_ADDRESS_OVERFLOW   0xD5

Definition at line 102 of file Usb.h.

#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL   0xD6

Definition at line 103 of file Usb.h.

#define USB_ERROR_EPINFO_IS_NULL   0xD7

Definition at line 104 of file Usb.h.

#define USB_ERROR_INVALID_ARGUMENT   0xD8

Definition at line 105 of file Usb.h.

#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE   0xD9

Definition at line 106 of file Usb.h.

#define USB_ERROR_INVALID_MAX_PKT_SIZE   0xDA

Definition at line 107 of file Usb.h.

#define USB_ERROR_EP_NOT_FOUND_IN_TBL   0xDB

Definition at line 108 of file Usb.h.

#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET   0xE0

Definition at line 109 of file Usb.h.

#define USB_ERROR_FailGetDevDescr   0xE1

Definition at line 110 of file Usb.h.

#define USB_ERROR_FailSetDevTblEntry   0xE2

Definition at line 111 of file Usb.h.

#define USB_ERROR_FailGetConfDescr   0xE3

Definition at line 112 of file Usb.h.

#define USB_ERROR_TRANSFER_TIMEOUT   0xFF

Definition at line 113 of file Usb.h.

#define USB_XFER_TIMEOUT   10000

Definition at line 115 of file Usb.h.

#define USB_RETRY_LIMIT   3

Definition at line 117 of file Usb.h.

#define USB_SETTLE_DELAY   200

Definition at line 118 of file Usb.h.

#define USB_NUMDEVICES   16

Definition at line 120 of file Usb.h.

#define HUB_PORT_RESET_DELAY   20

Definition at line 122 of file Usb.h.

#define USB_STATE_MASK   0xf0

Definition at line 125 of file Usb.h.

#define USB_STATE_DETACHED   0x10

Definition at line 127 of file Usb.h.

#define USB_DETACHED_SUBSTATE_INITIALIZE   0x11

Definition at line 128 of file Usb.h.

#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE   0x12

Definition at line 129 of file Usb.h.

#define USB_DETACHED_SUBSTATE_ILLEGAL   0x13

Definition at line 130 of file Usb.h.

#define USB_ATTACHED_SUBSTATE_SETTLE   0x20

Definition at line 131 of file Usb.h.

#define USB_ATTACHED_SUBSTATE_RESET_DEVICE   0x30

Definition at line 132 of file Usb.h.

#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE   0x40

Definition at line 133 of file Usb.h.

#define USB_ATTACHED_SUBSTATE_WAIT_SOF   0x50

Definition at line 134 of file Usb.h.

#define USB_ATTACHED_SUBSTATE_WAIT_RESET   0x51

Definition at line 135 of file Usb.h.

#define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE   0x60

Definition at line 136 of file Usb.h.

#define USB_STATE_ADDRESSING   0x70

Definition at line 137 of file Usb.h.

#define USB_STATE_CONFIGURING   0x80

Definition at line 138 of file Usb.h.

#define USB_STATE_RUNNING   0x90

Definition at line 139 of file Usb.h.

#define USB_STATE_ERROR   0xa0

Definition at line 140 of file Usb.h.

Typedef Documentation

typedef MAX3421e<P10, P9> MAX3421E

Definition at line 58 of file Usb.h.

typedef struct SETUP_PKT * PSETUP_PKT