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

# 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.

| USB host controller drivers
| These macros manage the USB Host controller.

| USB pipe drivers
| These macros manage the common features of the pipes.

## 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 | VBUSRISE_20MS 0x00
| OTG Timers customizing.
#define | VBUSRISE_50MS 0x01
#define | VBUSRISE_70MS 0x02
#define | VBUSRISE_100MS 0x03
#define | VBUSPULSE_15MS 0x20
#define | VBUSPULSE_23MS 0x21
#define | VBUSPULSE_31MS 0x22
#define | VBUSPULSE_40MS 0x23
#define | VFALLTMOUT_93MS 0x40
#define | VFALLTMOUT_105MS 0x41
#define | VFALLTMOUT_118MS 0x42
#define | VFALLTMOUT_131MS 0x43
#define | SRPMINDET_10US 0x60
#define | SRPMINDET_100US 0x61
#define | SRPMINDET_1MS 0x62
#define | SRPMINDET_11MS 0x63
#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 56 of file usb_drv.h.

Referenced by host_auto_configure_endpoint(), is_any_interrupt_pipe_active(), reset_it_pipe_str(), usb_general_interrupt(), usb_get_nb_pipe_interrupt(), and usb_select_enpoint_interrupt().

#define EP_CONTROL 0

Definition at line 58 of file usb_drv.h.

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

#define EP_1 1

Definition at line 59 of file usb_drv.h.

#define EP_2 2

Definition at line 60 of file usb_drv.h.

#define EP_3 3

Definition at line 61 of file usb_drv.h.

#define EP_4 4

Definition at line 62 of file usb_drv.h.

#define EP_5 5

Definition at line 63 of file usb_drv.h.

#define EP_6 6

Definition at line 64 of file usb_drv.h.

#define EP_7 7

Definition at line 65 of file usb_drv.h.

#define PIPE_CONTROL 0

Definition at line 67 of file usb_drv.h.

Referenced by usb_host_task().

#define PIPE_0 0

Definition at line 68 of file usb_drv.h.

#define PIPE_1 1

Definition at line 69 of file usb_drv.h.

#define PIPE_2 2

Definition at line 70 of file usb_drv.h.

#define PIPE_3 3

Definition at line 71 of file usb_drv.h.

#define PIPE_4 4

Definition at line 72 of file usb_drv.h.

#define PIPE_5 5

Definition at line 73 of file usb_drv.h.

#define PIPE_6 6

Definition at line 74 of file usb_drv.h.

#define PIPE_7 7

Definition at line 75 of file usb_drv.h.

#define MSK_EP_DIR 0x7F

Definition at line 78 of file usb_drv.h.

Referenced by host_auto_configure_endpoint(), host_mem_stall_management(), usb_clear_feature(), usb_get_status(), usb_mass_storage_cbw(), usb_process_request(), and usb_set_feature().

#define MSK_UADD 0x7F

Definition at line 79 of file usb_drv.h.

#define MSK_EPTYPE 0xC0

Definition at line 80 of file usb_drv.h.

#define MSK_EPSIZE 0x70

Definition at line 81 of file usb_drv.h.

#define MSK_EPBK 0x0C

Definition at line 82 of file usb_drv.h.

#define MSK_DTSEQ 0x0C

Definition at line 83 of file usb_drv.h.

#define MSK_NBUSYBK 0x03

Definition at line 101 of file usb_drv.h.

#define MSK_NBUSYBK 0x03

Definition at line 101 of file usb_drv.h.

#define MSK_CURRBK 0x03

Definition at line 85 of file usb_drv.h.

#define MSK_DAT 0xFF

Definition at line 86 of file usb_drv.h.

#define MSK_BYCTH 0x07

Definition at line 87 of file usb_drv.h.

#define MSK_BYCTL 0xFF

Definition at line 88 of file usb_drv.h.

#define MSK_EPINT 0x7F

Definition at line 89 of file usb_drv.h.

#define MSK_HADDR 0xFF

Definition at line 90 of file usb_drv.h.

#define MSK_PNUM 0x07

Definition at line 93 of file usb_drv.h.

#define MSK_PRST 0x7F

Definition at line 94 of file usb_drv.h.

#define MSK_PTYPE 0xC0

Definition at line 105 of file usb_drv.h.

#define MSK_PTYPE 0xC0

Definition at line 105 of file usb_drv.h.

#define MSK_PTOKEN 0x30

Definition at line 106 of file usb_drv.h.

#define MSK_PTOKEN 0x30

Definition at line 106 of file usb_drv.h.

#define MSK_PEPNUM 0x0F

Definition at line 110 of file usb_drv.h.

#define MSK_PEPNUM 0x0F

Definition at line 110 of file usb_drv.h.

#define MSK_PSIZE 0x70

Definition at line 112 of file usb_drv.h.

#define MSK_PSIZE 0x70

Definition at line 112 of file usb_drv.h.

#define MSK_PBK 0x0C

Definition at line 113 of file usb_drv.h.

#define MSK_PBK 0x0C

Definition at line 113 of file usb_drv.h.

#define MSK_ERROR 0x1F

Definition at line 103 of file usb_drv.h.

#define MSK_TOKEN_SETUP 0x30

Definition at line 107 of file usb_drv.h.

#define MSK_TOKEN_IN 0x10

Definition at line 108 of file usb_drv.h.

#define MSK_TOKEN_OUT 0x20

Definition at line 109 of file usb_drv.h.

#define TYPE_CONTROL 0

Definition at line 118 of file usb_drv.h.

Referenced by usb_host_task(), and usb_init_device().

#define TYPE_ISOCHRONOUS 1

Definition at line 119 of file usb_drv.h.

#define TYPE_BULK 2

Definition at line 120 of file usb_drv.h.

Referenced by host_auto_configure_endpoint(), and usb_user_endpoint_init().

#define TYPE_INTERRUPT 3

Definition at line 121 of file usb_drv.h.

Referenced by host_auto_configure_endpoint(), usb_general_interrupt(), and usb_pipe_interrupt().

#define DIRECTION_OUT 0

Definition at line 124 of file usb_drv.h.

Referenced by usb_init_device(), and usb_user_endpoint_init().

#define DIRECTION_IN 1

Definition at line 125 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define SIZE_8 0

Definition at line 128 of file usb_drv.h.

Referenced by host_auto_configure_endpoint(), host_determine_pipe_size(), and usb_init_device().

#define SIZE_16 1

Definition at line 129 of file usb_drv.h.

Referenced by host_determine_pipe_size().

#define SIZE_32 2

Definition at line 130 of file usb_drv.h.

Referenced by host_determine_pipe_size().

#define SIZE_64 3

Definition at line 131 of file usb_drv.h.

Referenced by host_determine_pipe_size(), usb_host_task(), usb_init_device(), and usb_user_endpoint_init().

#define SIZE_128 4

Definition at line 132 of file usb_drv.h.

Referenced by host_determine_pipe_size().

#define SIZE_256 5

Definition at line 133 of file usb_drv.h.

Referenced by host_determine_pipe_size().

#define SIZE_512 6

Definition at line 134 of file usb_drv.h.

Referenced by host_determine_pipe_size().

#define SIZE_1024 7

Definition at line 135 of file usb_drv.h.

Referenced by host_determine_pipe_size().

#define ONE_BANK 0

Definition at line 139 of file usb_drv.h.

Referenced by host_auto_configure_endpoint(), usb_host_task(), and usb_init_device().

#define TWO_BANKS 1

Definition at line 140 of file usb_drv.h.

Referenced by host_auto_configure_endpoint(), and usb_user_endpoint_init().

#define NYET_ENABLED 0

Definition at line 143 of file usb_drv.h.

Referenced by usb_user_endpoint_init().

#define NYET_DISABLED 1

Definition at line 144 of file usb_drv.h.

Referenced by usb_init_device().

#define TOKEN_SETUP 0

Definition at line 147 of file usb_drv.h.

Referenced by usb_host_task().

#define TOKEN_IN 1

Definition at line 148 of file usb_drv.h.

Referenced by host_auto_configure_endpoint().

#define TOKEN_OUT 2

Definition at line 149 of file usb_drv.h.

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

Definition at line 151 of file usb_drv.h.

Referenced by host_mem_install().

#define VBUSRISE_20MS 0x00

OTG Timers customizing.

Definition at line 155 of file usb_drv.h.

#define VBUSRISE_50MS 0x01

Definition at line 156 of file usb_drv.h.

#define VBUSRISE_70MS 0x02

Definition at line 157 of file usb_drv.h.

#define VBUSRISE_100MS 0x03

Definition at line 158 of file usb_drv.h.

#define VBUSPULSE_15MS 0x20

Definition at line 160 of file usb_drv.h.

#define VBUSPULSE_23MS 0x21

Definition at line 161 of file usb_drv.h.

#define VBUSPULSE_31MS 0x22

Definition at line 162 of file usb_drv.h.

#define VBUSPULSE_40MS 0x23

Definition at line 163 of file usb_drv.h.

#define VFALLTMOUT_93MS 0x40

Definition at line 165 of file usb_drv.h.

#define VFALLTMOUT_105MS 0x41

Definition at line 166 of file usb_drv.h.

#define VFALLTMOUT_118MS 0x42

Definition at line 167 of file usb_drv.h.

#define VFALLTMOUT_131MS 0x43

Definition at line 168 of file usb_drv.h.

#define SRPMINDET_10US 0x60

Definition at line 170 of file usb_drv.h.

#define SRPMINDET_100US 0x61

Definition at line 171 of file usb_drv.h.

#define SRPMINDET_1MS 0x62

Definition at line 172 of file usb_drv.h.

#define SRPMINDET_11MS 0x63

Definition at line 173 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 932 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 951 of file usb_drv.h.