Modules | Defines

# USB low level drivers

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&USB_ENDPOINT_DIR_MASK)? 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 59 of file usb_drv.h.

Referenced by usb_select_enpoint_interrupt().

#define EP_CONTROL 0

Definition at line 61 of file usb_drv.h.

Referenced by usb_clear_feature(), usb_device_task(), usb_init_device(), usb_process_request(), usb_set_feature(), and usb_set_interface().

#define EP_1 1

Definition at line 62 of file usb_drv.h.

#define EP_2 2

Definition at line 63 of file usb_drv.h.

#define EP_3 3

Definition at line 64 of file usb_drv.h.

#define EP_4 4

Definition at line 65 of file usb_drv.h.

#define EP_5 5

Definition at line 66 of file usb_drv.h.

#define EP_6 6

Definition at line 67 of file usb_drv.h.

#define EP_7 7

Definition at line 68 of file usb_drv.h.

#define PIPE_CONTROL 0

Definition at line 70 of file usb_drv.h.

#define PIPE_0 0

Definition at line 71 of file usb_drv.h.

#define PIPE_1 1

Definition at line 72 of file usb_drv.h.

#define PIPE_2 2

Definition at line 73 of file usb_drv.h.

#define PIPE_3 3

Definition at line 74 of file usb_drv.h.

#define PIPE_4 4

Definition at line 75 of file usb_drv.h.

#define PIPE_5 5

Definition at line 76 of file usb_drv.h.

#define PIPE_6 6

Definition at line 77 of file usb_drv.h.

#define PIPE_7 7

Definition at line 78 of file usb_drv.h.

#define MSK_EP_DIR 0x7F

Definition at line 81 of file usb_drv.h.

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

#define MSK_UADD 0x7F

Definition at line 82 of file usb_drv.h.

#define MSK_EPTYPE 0xC0

Definition at line 83 of file usb_drv.h.

#define MSK_EPSIZE 0x70

Definition at line 84 of file usb_drv.h.

#define MSK_EPBK 0x0C

Definition at line 85 of file usb_drv.h.

#define MSK_DTSEQ 0x0C

Definition at line 86 of file usb_drv.h.

#define MSK_NBUSYBK 0x03

Definition at line 104 of file usb_drv.h.

#define MSK_NBUSYBK 0x03

Definition at line 104 of file usb_drv.h.

#define MSK_CURRBK 0x03

Definition at line 88 of file usb_drv.h.

#define MSK_DAT 0xFF

Definition at line 89 of file usb_drv.h.

#define MSK_BYCTH 0x07

Definition at line 90 of file usb_drv.h.

#define MSK_BYCTL 0xFF

Definition at line 91 of file usb_drv.h.

#define MSK_EPINT 0x7F

Definition at line 92 of file usb_drv.h.

#define MSK_HADDR 0xFF

Definition at line 93 of file usb_drv.h.

#define MSK_PNUM 0x07

Definition at line 96 of file usb_drv.h.

#define MSK_PRST 0x7F

Definition at line 97 of file usb_drv.h.

#define MSK_PTYPE 0xC0

Definition at line 108 of file usb_drv.h.

#define MSK_PTYPE 0xC0

Definition at line 108 of file usb_drv.h.

#define MSK_PTOKEN 0x30

Definition at line 109 of file usb_drv.h.

#define MSK_PTOKEN 0x30

Definition at line 109 of file usb_drv.h.

#define MSK_PEPNUM 0x0F

Definition at line 113 of file usb_drv.h.

#define MSK_PEPNUM 0x0F

Definition at line 113 of file usb_drv.h.

#define MSK_PSIZE 0x70

Definition at line 115 of file usb_drv.h.

#define MSK_PSIZE 0x70

Definition at line 115 of file usb_drv.h.

#define MSK_PBK 0x0C

Definition at line 116 of file usb_drv.h.

#define MSK_PBK 0x0C

Definition at line 116 of file usb_drv.h.

#define MSK_ERROR 0x1F

Definition at line 106 of file usb_drv.h.

#define MSK_TOKEN_SETUP 0x30

Definition at line 110 of file usb_drv.h.

#define MSK_TOKEN_IN 0x10

Definition at line 111 of file usb_drv.h.

#define MSK_TOKEN_OUT 0x20

Definition at line 112 of file usb_drv.h.

#define TYPE_CONTROL 0

Definition at line 121 of file usb_drv.h.

Referenced by usb_init_device().

#define TYPE_ISOCHRONOUS 1

Definition at line 122 of file usb_drv.h.

#define TYPE_BULK 2

Definition at line 123 of file usb_drv.h.

#define TYPE_INTERRUPT 3

Definition at line 124 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define DIRECTION_OUT 0

Definition at line 127 of file usb_drv.h.

Referenced by usb_init_device().

#define DIRECTION_IN 1

Definition at line 128 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define SIZE_8 0

Definition at line 131 of file usb_drv.h.

Referenced by usb_init_device(), and usb_user_endpoint_init().

#define SIZE_16 1

Definition at line 132 of file usb_drv.h.

#define SIZE_32 2

Definition at line 133 of file usb_drv.h.

Referenced by usb_init_device().

#define SIZE_64 3

Definition at line 134 of file usb_drv.h.

#define SIZE_128 4

Definition at line 135 of file usb_drv.h.

#define SIZE_256 5

Definition at line 136 of file usb_drv.h.

#define SIZE_512 6

Definition at line 137 of file usb_drv.h.

#define SIZE_1024 7

Definition at line 138 of file usb_drv.h.

#define ONE_BANK 0

Definition at line 142 of file usb_drv.h.

Referenced by usb_init_device(), and usb_user_endpoint_init().

#define TWO_BANKS 1

Definition at line 143 of file usb_drv.h.

#define NYET_ENABLED 0

Definition at line 146 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define NYET_DISABLED 1

Definition at line 147 of file usb_drv.h.

Referenced by usb_init_device().

#define TOKEN_SETUP 0

Definition at line 150 of file usb_drv.h.

#define TOKEN_IN 1

Definition at line 151 of file usb_drv.h.

#define TOKEN_OUT 2

Definition at line 152 of file usb_drv.h.

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

Definition at line 154 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 500 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 519 of file usb_drv.h.