Prusa MINI Firmware overview
usbh_def.h File Reference

Definitions used in the USB host library. More...

#include "usbh_conf.h"

Go to the source code of this file.

Classes

union  uint16_t_uint8_t
 
struct  uint16_t_uint8_t::BW
 
union  _USB_Setup
 
struct  _USB_Setup::_SetupPkt_Struc
 
struct  _DescHeader
 
struct  _DeviceDescriptor
 
struct  _EndpointDescriptor
 
struct  _InterfaceDescriptor
 
struct  _ConfigurationDescriptor
 
struct  USBH_CtrlTypeDef
 
struct  USBH_DeviceTypeDef
 
struct  USBH_ClassTypeDef
 
struct  _USBH_HandleTypeDef
 

Macros

#define NULL   0
 
#define FALSE   0
 
#define TRUE   1
 
#define ValBit(VAR, POS)   (VAR & (1 << POS))
 
#define SetBit(VAR, POS)   (VAR |= (1 << POS))
 
#define ClrBit(VAR, POS)   (VAR &= ((1 << POS)^255))
 
#define LE16(addr)
 
#define LE16S(addr)   (uint16_t)(LE16((addr)))
 
#define LE32(addr)
 
#define LE64(addr)
 
#define LE24(addr)
 
#define LE32S(addr)   (int32_t)(LE32((addr)))
 
#define USB_LEN_DESC_HDR   0x02
 
#define USB_LEN_DEV_DESC   0x12
 
#define USB_LEN_CFG_DESC   0x09
 
#define USB_LEN_IF_DESC   0x09
 
#define USB_LEN_EP_DESC   0x07
 
#define USB_LEN_OTG_DESC   0x03
 
#define USB_LEN_SETUP_PKT   0x08
 
#define USB_REQ_DIR_MASK   0x80
 
#define USB_H2D   0x00
 
#define USB_D2H   0x80
 
#define USB_REQ_TYPE_STANDARD   0x00
 
#define USB_REQ_TYPE_CLASS   0x20
 
#define USB_REQ_TYPE_VENDOR   0x40
 
#define USB_REQ_TYPE_RESERVED   0x60
 
#define USB_REQ_RECIPIENT_DEVICE   0x00
 
#define USB_REQ_RECIPIENT_INTERFACE   0x01
 
#define USB_REQ_RECIPIENT_ENDPOINT   0x02
 
#define USB_REQ_RECIPIENT_OTHER   0x03
 
#define USB_REQ_GET_STATUS   0x00
 
#define USB_REQ_CLEAR_FEATURE   0x01
 
#define USB_REQ_SET_FEATURE   0x03
 
#define USB_REQ_SET_ADDRESS   0x05
 
#define USB_REQ_GET_DESCRIPTOR   0x06
 
#define USB_REQ_SET_DESCRIPTOR   0x07
 
#define USB_REQ_GET_CONFIGURATION   0x08
 
#define USB_REQ_SET_CONFIGURATION   0x09
 
#define USB_REQ_GET_INTERFACE   0x0A
 
#define USB_REQ_SET_INTERFACE   0x0B
 
#define USB_REQ_SYNCH_FRAME   0x0C
 
#define USB_DESC_TYPE_DEVICE   1
 
#define USB_DESC_TYPE_CONFIGURATION   2
 
#define USB_DESC_TYPE_STRING   3
 
#define USB_DESC_TYPE_INTERFACE   4
 
#define USB_DESC_TYPE_ENDPOINT   5
 
#define USB_DESC_TYPE_DEVICE_QUALIFIER   6
 
#define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION   7
 
#define USB_DESC_TYPE_INTERFACE_POWER   8
 
#define USB_DESC_TYPE_HID   0x21
 
#define USB_DESC_TYPE_HID_REPORT   0x22
 
#define USB_DEVICE_DESC_SIZE   18
 
#define USB_CONFIGURATION_DESC_SIZE   9
 
#define USB_HID_DESC_SIZE   9
 
#define USB_INTERFACE_DESC_SIZE   9
 
#define USB_ENDPOINT_DESC_SIZE   7
 
#define USB_DESC_DEVICE   ((USB_DESC_TYPE_DEVICE << 8) & 0xFF00)
 
#define USB_DESC_CONFIGURATION   ((USB_DESC_TYPE_CONFIGURATION << 8) & 0xFF00)
 
#define USB_DESC_STRING   ((USB_DESC_TYPE_STRING << 8) & 0xFF00)
 
#define USB_DESC_INTERFACE   ((USB_DESC_TYPE_INTERFACE << 8) & 0xFF00)
 
#define USB_DESC_ENDPOINT   ((USB_DESC_TYPE_INTERFACE << 8) & 0xFF00)
 
#define USB_DESC_DEVICE_QUALIFIER   ((USB_DESC_TYPE_DEVICE_QUALIFIER << 8) & 0xFF00)
 
#define USB_DESC_OTHER_SPEED_CONFIGURATION   ((USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION << 8) & 0xFF00)
 
#define USB_DESC_INTERFACE_POWER   ((USB_DESC_TYPE_INTERFACE_POWER << 8) & 0xFF00)
 
#define USB_DESC_HID_REPORT   ((USB_DESC_TYPE_HID_REPORT << 8) & 0xFF00)
 
#define USB_DESC_HID   ((USB_DESC_TYPE_HID << 8) & 0xFF00)
 
#define USB_EP_TYPE_CTRL   0x00
 
#define USB_EP_TYPE_ISOC   0x01
 
#define USB_EP_TYPE_BULK   0x02
 
#define USB_EP_TYPE_INTR   0x03
 
#define USB_EP_DIR_OUT   0x00
 
#define USB_EP_DIR_IN   0x80
 
#define USB_EP_DIR_MSK   0x80
 
#define USBH_MAX_PIPES_NBR   15
 
#define USBH_DEVICE_ADDRESS_DEFAULT   0
 
#define USBH_MAX_ERROR_COUNT   2
 
#define USBH_DEVICE_ADDRESS   1
 
#define USBH_CONFIGURATION_DESCRIPTOR_SIZE
 
#define CONFIG_DESC_wTOTAL_LENGTH
 

Typedefs

typedef union _USB_Setup USB_Setup_TypeDef
 
typedef struct _DescHeader USBH_DescHeader_t
 
typedef struct _DeviceDescriptor USBH_DevDescTypeDef
 
typedef struct _EndpointDescriptor USBH_EpDescTypeDef
 
typedef struct _InterfaceDescriptor USBH_InterfaceDescTypeDef
 
typedef struct _ConfigurationDescriptor USBH_CfgDescTypeDef
 
typedef struct _USBH_HandleTypeDef USBH_HandleTypeDef
 

Enumerations

enum  USBH_StatusTypeDef {
  USBH_OK = 0, USBH_BUSY, USBH_FAIL, USBH_NOT_SUPPORTED,
  USBH_UNRECOVERED_ERROR, USBH_ERROR_SPEED_UNKNOWN
}
 
enum  USBH_SpeedTypeDef { USBH_SPEED_HIGH = 0, USBH_SPEED_FULL = 1, USBH_SPEED_LOW = 2 }
 
enum  HOST_StateTypeDef {
  HOST_IDLE =0, HOST_DEV_WAIT_FOR_ATTACHMENT, HOST_DEV_ATTACHED, HOST_DEV_DISCONNECTED,
  HOST_DETECT_DEVICE_SPEED, HOST_ENUMERATION, HOST_CLASS_REQUEST, HOST_INPUT,
  HOST_SET_CONFIGURATION, HOST_CHECK_CLASS, HOST_CLASS, HOST_SUSPENDED,
  HOST_ABORT_STATE
}
 
enum  ENUM_StateTypeDef {
  ENUM_IDLE = 0, ENUM_GET_FULL_DEV_DESC, ENUM_SET_ADDR, ENUM_GET_CFG_DESC,
  ENUM_GET_FULL_CFG_DESC, ENUM_GET_MFC_STRING_DESC, ENUM_GET_PRODUCT_STRING_DESC, ENUM_GET_SERIALNUM_STRING_DESC
}
 
enum  CTRL_StateTypeDef {
  CTRL_IDLE =0, CTRL_SETUP, CTRL_SETUP_WAIT, CTRL_DATA_IN,
  CTRL_DATA_IN_WAIT, CTRL_DATA_OUT, CTRL_DATA_OUT_WAIT, CTRL_STATUS_IN,
  CTRL_STATUS_IN_WAIT, CTRL_STATUS_OUT, CTRL_STATUS_OUT_WAIT, CTRL_ERROR,
  CTRL_STALLED, CTRL_COMPLETE
}
 
enum  CMD_StateTypeDef { CMD_IDLE =0, CMD_SEND, CMD_WAIT }
 
enum  USBH_URBStateTypeDef {
  USBH_URB_IDLE = 0, USBH_URB_DONE, USBH_URB_NOTREADY, USBH_URB_NYET,
  USBH_URB_ERROR, USBH_URB_STALL
}
 
enum  USBH_OSEventTypeDef {
  USBH_PORT_EVENT = 1, USBH_URB_EVENT, USBH_CONTROL_EVENT, USBH_CLASS_EVENT,
  USBH_STATE_CHANGED_EVENT
}
 

Detailed Description

Definitions used in the USB host library.

Author
MCD Application Team
Version
V3.2.2
Date
07-July-2015
Attention

© COPYRIGHT 2015 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.