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

# USB low level drivers module

Collaboration diagram for USB low level drivers module:

USB low level drivers Module. More...

## Modules
| Configuration macros for endpoints
| List of the standard macro used to configure pipes and endpoints.

| USB Pads Regulator drivers
| Turns ON/OFF USB pads regulator.

| USB common management drivers
| These macros manage the USB controller.

| USB device controller drivers
| These macros manage the USB Device controller.

| USB endpoint drivers
| These macros manage the common features of the endpoints.

## Defines
#define | MAX_EP_NB 7
#define | EP_CONTROL 0
#define | EP_1 1
#define | EP_2 2
#define | EP_3 3
#define | EP_4 4
#define | EP_5 5
#define | EP_6 6
#define | EP_7 7
#define | PIPE_CONTROL 0
#define | PIPE_0 0
#define | PIPE_1 1
#define | PIPE_2 2
#define | PIPE_3 3
#define | PIPE_4 4
#define | PIPE_5 5
#define | PIPE_6 6
#define | PIPE_7 7
#define | MSK_EP_DIR 0x7F
#define | MSK_UADD 0x7F
#define | MSK_EPTYPE 0xC0
#define | MSK_EPSIZE 0x70
#define | MSK_EPBK 0x0C
#define | MSK_DTSEQ 0x0C
#define | MSK_NBUSYBK 0x03
#define | MSK_CURRBK 0x03
#define | MSK_DAT 0xFF
#define | MSK_BYCTH 0x07
#define | MSK_BYCTL 0xFF
#define | MSK_EPINT 0x7F
#define | MSK_HADDR 0xFF
#define | MSK_PNUM 0x07
#define | MSK_PRST 0x7F
#define | MSK_PTYPE 0xC0
#define | MSK_PTOKEN 0x30
#define | MSK_PEPNUM 0x0F
#define | MSK_PSIZE 0x70
#define | MSK_PBK 0x0C
#define | MSK_ERROR 0x1F
#define | MSK_TOKEN_SETUP 0x30
#define | MSK_TOKEN_IN 0x10
#define | MSK_TOKEN_OUT 0x20
#define | TYPE_CONTROL 0
#define | TYPE_ISOCHRONOUS 1
#define | TYPE_BULK 2
#define | TYPE_INTERRUPT 3
#define | DIRECTION_OUT 0
#define | DIRECTION_IN 1
#define | SIZE_8 0
#define | SIZE_16 1
#define | SIZE_32 2
#define | SIZE_64 3
#define | SIZE_128 4
#define | SIZE_256 5
#define | SIZE_512 6
#define | SIZE_1024 7
#define | ONE_BANK 0
#define | TWO_BANKS 1
#define | NYET_ENABLED 0
#define | NYET_DISABLED 1
#define | TOKEN_SETUP 0
#define | TOKEN_IN 1
#define | TOKEN_OUT 2
#define | Is_ep_addr_in(x) ( (x&0x80)? TRUE : FALSE)
#define | wSWAP(x)
| wSWAP This macro swaps the U8 order in words.
#define | Usb_write_word_enum_struc(x) (wSWAP(x))
| Usb_write_word_enum_struc This macro help to fill the U16 fill in USB enumeration struct.

## Detailed Description

USB low level drivers Module.

## Define Documentation

#define MAX_EP_NB 7

Definition at line 30 of file usb_drv.h.

Referenced by usb_select_enpoint_interrupt().

#define EP_CONTROL 0

Definition at line 32 of file usb_drv.h.

Referenced by usb_clear_feature(), usb_device_task(), usb_init_device(), usb_mass_storage_csw(), and usb_set_feature().

#define EP_1 1

Definition at line 33 of file usb_drv.h.

#define EP_2 2

Definition at line 34 of file usb_drv.h.

#define EP_3 3

Definition at line 35 of file usb_drv.h.

#define EP_4 4

Definition at line 36 of file usb_drv.h.

#define EP_5 5

Definition at line 37 of file usb_drv.h.

#define EP_6 6

Definition at line 38 of file usb_drv.h.

#define EP_7 7

Definition at line 39 of file usb_drv.h.

#define PIPE_CONTROL 0

Definition at line 41 of file usb_drv.h.

#define PIPE_0 0

Definition at line 42 of file usb_drv.h.

#define PIPE_1 1

Definition at line 43 of file usb_drv.h.

#define PIPE_2 2

Definition at line 44 of file usb_drv.h.

#define PIPE_3 3

Definition at line 45 of file usb_drv.h.

#define PIPE_4 4

Definition at line 46 of file usb_drv.h.

#define PIPE_5 5

Definition at line 47 of file usb_drv.h.

#define PIPE_6 6

Definition at line 48 of file usb_drv.h.

#define PIPE_7 7

Definition at line 49 of file usb_drv.h.

#define MSK_EP_DIR 0x7F

Definition at line 52 of file usb_drv.h.

Referenced by usb_clear_feature(), usb_get_status(), and usb_set_feature().

#define MSK_UADD 0x7F

Definition at line 53 of file usb_drv.h.

#define MSK_EPTYPE 0xC0

Definition at line 54 of file usb_drv.h.

#define MSK_EPSIZE 0x70

Definition at line 55 of file usb_drv.h.

#define MSK_EPBK 0x0C

Definition at line 56 of file usb_drv.h.

#define MSK_DTSEQ 0x0C

Definition at line 57 of file usb_drv.h.

#define MSK_NBUSYBK 0x03

Definition at line 75 of file usb_drv.h.

#define MSK_NBUSYBK 0x03

Definition at line 75 of file usb_drv.h.

#define MSK_CURRBK 0x03

Definition at line 59 of file usb_drv.h.

#define MSK_DAT 0xFF

Definition at line 60 of file usb_drv.h.

#define MSK_BYCTH 0x07

Definition at line 61 of file usb_drv.h.

#define MSK_BYCTL 0xFF

Definition at line 62 of file usb_drv.h.

#define MSK_EPINT 0x7F

Definition at line 63 of file usb_drv.h.

#define MSK_HADDR 0xFF

Definition at line 64 of file usb_drv.h.

#define MSK_PNUM 0x07

Definition at line 67 of file usb_drv.h.

#define MSK_PRST 0x7F

Definition at line 68 of file usb_drv.h.

#define MSK_PTYPE 0xC0

Definition at line 79 of file usb_drv.h.

#define MSK_PTYPE 0xC0

Definition at line 79 of file usb_drv.h.

#define MSK_PTOKEN 0x30

Definition at line 80 of file usb_drv.h.

#define MSK_PTOKEN 0x30

Definition at line 80 of file usb_drv.h.

#define MSK_PEPNUM 0x0F

Definition at line 84 of file usb_drv.h.

#define MSK_PEPNUM 0x0F

Definition at line 84 of file usb_drv.h.

#define MSK_PSIZE 0x70

Definition at line 86 of file usb_drv.h.

#define MSK_PSIZE 0x70

Definition at line 86 of file usb_drv.h.

#define MSK_PBK 0x0C

Definition at line 87 of file usb_drv.h.

#define MSK_PBK 0x0C

Definition at line 87 of file usb_drv.h.

#define MSK_ERROR 0x1F

Definition at line 77 of file usb_drv.h.

#define MSK_TOKEN_SETUP 0x30

Definition at line 81 of file usb_drv.h.

#define MSK_TOKEN_IN 0x10

Definition at line 82 of file usb_drv.h.

#define MSK_TOKEN_OUT 0x20

Definition at line 83 of file usb_drv.h.

#define TYPE_CONTROL 0

Definition at line 92 of file usb_drv.h.

Referenced by usb_init_device().

#define TYPE_ISOCHRONOUS 1

Definition at line 93 of file usb_drv.h.

#define TYPE_BULK 2

Definition at line 94 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define TYPE_INTERRUPT 3

Definition at line 95 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define DIRECTION_OUT 0

Definition at line 98 of file usb_drv.h.

Referenced by usb_init_device(), and usb_user_endpoint_init().

#define DIRECTION_IN 1

Definition at line 99 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define SIZE_8 0

Definition at line 102 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define SIZE_16 1

Definition at line 103 of file usb_drv.h.

#define SIZE_32 2

Definition at line 104 of file usb_drv.h.

Referenced by usb_init_device().

#define SIZE_64 3

Definition at line 105 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define SIZE_128 4

Definition at line 106 of file usb_drv.h.

#define SIZE_256 5

Definition at line 107 of file usb_drv.h.

#define SIZE_512 6

Definition at line 108 of file usb_drv.h.

#define SIZE_1024 7

Definition at line 109 of file usb_drv.h.

#define ONE_BANK 0

Definition at line 113 of file usb_drv.h.

Referenced by usb_init_device(), and usb_user_endpoint_init().

#define TWO_BANKS 1

Definition at line 114 of file usb_drv.h.

#define NYET_ENABLED 0

Definition at line 117 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define NYET_DISABLED 1

Definition at line 118 of file usb_drv.h.

Referenced by usb_init_device().

#define TOKEN_SETUP 0

Definition at line 121 of file usb_drv.h.

#define TOKEN_IN 1

Definition at line 122 of file usb_drv.h.

#define TOKEN_OUT 2

Definition at line 123 of file usb_drv.h.

#define Is_ep_addr_in | ( | x |  | ) | ( (x&0x80)? TRUE : FALSE)

Definition at line 125 of file usb_drv.h.

#define wSWAP | ( | x |  | ) |

Value:

    (   (((x)>>8)&0x00FF) \
       |   (((x)<<8)&0xFF00) \
       )

wSWAP This macro swaps the U8 order in words.

Parameters:

  | x | (U16) the 16 bit word to swap

Returns:
  (U16) the 16 bit word x with the 2 bytes swaped

Definition at line 476 of file usb_drv.h.

#define Usb_write_word_enum_struc | ( | x |  | ) | (wSWAP(x))

Usb_write_word_enum_struc This macro help to fill the U16 fill in USB enumeration struct.

Depending on the CPU architecture, the macro swap or not the nibbles

Parameters:

  | x | (U16) the 16 bit word to be written

Returns:
  (U16) the 16 bit word written

Definition at line 495 of file usb_drv.h.