Prusa MINI Firmware overview

This file is includes USB descriptors. More...

Collaboration diagram for USBH_DEF:

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
 

Detailed Description

This file is includes USB descriptors.

Macro Definition Documentation

◆ NULL

#define NULL   0

◆ FALSE

#define FALSE   0

◆ TRUE

#define TRUE   1

◆ ValBit

#define ValBit (   VAR,
  POS 
)    (VAR & (1 << POS))

◆ SetBit

#define SetBit (   VAR,
  POS 
)    (VAR |= (1 << POS))

◆ ClrBit

#define ClrBit (   VAR,
  POS 
)    (VAR &= ((1 << POS)^255))

◆ LE16

#define LE16 (   addr)
Value:
(((uint16_t)(*((uint8_t *)(addr))))\
+ (((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8))

◆ LE16S

#define LE16S (   addr)    (uint16_t)(LE16((addr)))

◆ LE32

#define LE32 (   addr)
Value:
((((uint32_t)(*(((uint8_t *)(addr)) + 0))) + \
(((uint32_t)(*(((uint8_t *)(addr)) + 1))) << 8) + \
(((uint32_t)(*(((uint8_t *)(addr)) + 2))) << 16) + \
(((uint32_t)(*(((uint8_t *)(addr)) + 3))) << 24)))

◆ LE64

#define LE64 (   addr)
Value:
((((uint64_t)(*(((uint8_t *)(addr)) + 0))) + \
(((uint64_t)(*(((uint8_t *)(addr)) + 1))) << 8) +\
(((uint64_t)(*(((uint8_t *)(addr)) + 2))) << 16) +\
(((uint64_t)(*(((uint8_t *)(addr)) + 3))) << 24) +\
(((uint64_t)(*(((uint8_t *)(addr)) + 4))) << 32) +\
(((uint64_t)(*(((uint8_t *)(addr)) + 5))) << 40) +\
(((uint64_t)(*(((uint8_t *)(addr)) + 6))) << 48) +\
(((uint64_t)(*(((uint8_t *)(addr)) + 7))) << 56)))

◆ LE24

#define LE24 (   addr)
Value:
((((uint32_t)(*(((uint8_t *)(addr)) + 0))) + \
(((uint32_t)(*(((uint8_t *)(addr)) + 1))) << 8) + \
(((uint32_t)(*(((uint8_t *)(addr)) + 2))) << 16)))

◆ LE32S

#define LE32S (   addr)    (int32_t)(LE32((addr)))

◆ USB_LEN_DESC_HDR

#define USB_LEN_DESC_HDR   0x02

◆ USB_LEN_DEV_DESC

#define USB_LEN_DEV_DESC   0x12

◆ USB_LEN_CFG_DESC

#define USB_LEN_CFG_DESC   0x09

◆ USB_LEN_IF_DESC

#define USB_LEN_IF_DESC   0x09

◆ USB_LEN_EP_DESC

#define USB_LEN_EP_DESC   0x07

◆ USB_LEN_OTG_DESC

#define USB_LEN_OTG_DESC   0x03

◆ USB_LEN_SETUP_PKT

#define USB_LEN_SETUP_PKT   0x08

◆ USB_REQ_DIR_MASK

#define USB_REQ_DIR_MASK   0x80

◆ USB_H2D

#define USB_H2D   0x00

◆ USB_D2H

#define USB_D2H   0x80

◆ USB_REQ_TYPE_STANDARD

#define USB_REQ_TYPE_STANDARD   0x00

◆ USB_REQ_TYPE_CLASS

#define USB_REQ_TYPE_CLASS   0x20

◆ USB_REQ_TYPE_VENDOR

#define USB_REQ_TYPE_VENDOR   0x40

◆ USB_REQ_TYPE_RESERVED

#define USB_REQ_TYPE_RESERVED   0x60

◆ USB_REQ_RECIPIENT_DEVICE

#define USB_REQ_RECIPIENT_DEVICE   0x00

◆ USB_REQ_RECIPIENT_INTERFACE

#define USB_REQ_RECIPIENT_INTERFACE   0x01

◆ USB_REQ_RECIPIENT_ENDPOINT

#define USB_REQ_RECIPIENT_ENDPOINT   0x02

◆ USB_REQ_RECIPIENT_OTHER

#define USB_REQ_RECIPIENT_OTHER   0x03

◆ USB_REQ_GET_STATUS

#define USB_REQ_GET_STATUS   0x00

◆ USB_REQ_CLEAR_FEATURE

#define USB_REQ_CLEAR_FEATURE   0x01

◆ USB_REQ_SET_FEATURE

#define USB_REQ_SET_FEATURE   0x03

◆ USB_REQ_SET_ADDRESS

#define USB_REQ_SET_ADDRESS   0x05

◆ USB_REQ_GET_DESCRIPTOR

#define USB_REQ_GET_DESCRIPTOR   0x06

◆ USB_REQ_SET_DESCRIPTOR

#define USB_REQ_SET_DESCRIPTOR   0x07

◆ USB_REQ_GET_CONFIGURATION

#define USB_REQ_GET_CONFIGURATION   0x08

◆ USB_REQ_SET_CONFIGURATION

#define USB_REQ_SET_CONFIGURATION   0x09

◆ USB_REQ_GET_INTERFACE

#define USB_REQ_GET_INTERFACE   0x0A

◆ USB_REQ_SET_INTERFACE

#define USB_REQ_SET_INTERFACE   0x0B

◆ USB_REQ_SYNCH_FRAME

#define USB_REQ_SYNCH_FRAME   0x0C

◆ USB_DESC_TYPE_DEVICE

#define USB_DESC_TYPE_DEVICE   1

◆ USB_DESC_TYPE_CONFIGURATION

#define USB_DESC_TYPE_CONFIGURATION   2

◆ USB_DESC_TYPE_STRING

#define USB_DESC_TYPE_STRING   3

◆ USB_DESC_TYPE_INTERFACE

#define USB_DESC_TYPE_INTERFACE   4

◆ USB_DESC_TYPE_ENDPOINT

#define USB_DESC_TYPE_ENDPOINT   5

◆ USB_DESC_TYPE_DEVICE_QUALIFIER

#define USB_DESC_TYPE_DEVICE_QUALIFIER   6

◆ USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION

#define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION   7

◆ USB_DESC_TYPE_INTERFACE_POWER

#define USB_DESC_TYPE_INTERFACE_POWER   8

◆ USB_DESC_TYPE_HID

#define USB_DESC_TYPE_HID   0x21

◆ USB_DESC_TYPE_HID_REPORT

#define USB_DESC_TYPE_HID_REPORT   0x22

◆ USB_DEVICE_DESC_SIZE

#define USB_DEVICE_DESC_SIZE   18

◆ USB_CONFIGURATION_DESC_SIZE

#define USB_CONFIGURATION_DESC_SIZE   9

◆ USB_HID_DESC_SIZE

#define USB_HID_DESC_SIZE   9

◆ USB_INTERFACE_DESC_SIZE

#define USB_INTERFACE_DESC_SIZE   9

◆ USB_ENDPOINT_DESC_SIZE

#define USB_ENDPOINT_DESC_SIZE   7

◆ USB_DESC_DEVICE

#define USB_DESC_DEVICE   ((USB_DESC_TYPE_DEVICE << 8) & 0xFF00)

◆ USB_DESC_CONFIGURATION

#define USB_DESC_CONFIGURATION   ((USB_DESC_TYPE_CONFIGURATION << 8) & 0xFF00)

◆ USB_DESC_STRING

#define USB_DESC_STRING   ((USB_DESC_TYPE_STRING << 8) & 0xFF00)

◆ USB_DESC_INTERFACE

#define USB_DESC_INTERFACE   ((USB_DESC_TYPE_INTERFACE << 8) & 0xFF00)

◆ USB_DESC_ENDPOINT

#define USB_DESC_ENDPOINT   ((USB_DESC_TYPE_INTERFACE << 8) & 0xFF00)

◆ USB_DESC_DEVICE_QUALIFIER

#define USB_DESC_DEVICE_QUALIFIER   ((USB_DESC_TYPE_DEVICE_QUALIFIER << 8) & 0xFF00)

◆ USB_DESC_OTHER_SPEED_CONFIGURATION

#define USB_DESC_OTHER_SPEED_CONFIGURATION   ((USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION << 8) & 0xFF00)

◆ USB_DESC_INTERFACE_POWER

#define USB_DESC_INTERFACE_POWER   ((USB_DESC_TYPE_INTERFACE_POWER << 8) & 0xFF00)

◆ USB_DESC_HID_REPORT

#define USB_DESC_HID_REPORT   ((USB_DESC_TYPE_HID_REPORT << 8) & 0xFF00)

◆ USB_DESC_HID

#define USB_DESC_HID   ((USB_DESC_TYPE_HID << 8) & 0xFF00)

◆ USB_EP_TYPE_CTRL

#define USB_EP_TYPE_CTRL   0x00

◆ USB_EP_TYPE_ISOC

#define USB_EP_TYPE_ISOC   0x01

◆ USB_EP_TYPE_BULK

#define USB_EP_TYPE_BULK   0x02

◆ USB_EP_TYPE_INTR

#define USB_EP_TYPE_INTR   0x03

◆ USB_EP_DIR_OUT

#define USB_EP_DIR_OUT   0x00

◆ USB_EP_DIR_IN

#define USB_EP_DIR_IN   0x80

◆ USB_EP_DIR_MSK

#define USB_EP_DIR_MSK   0x80

◆ USBH_MAX_PIPES_NBR

#define USBH_MAX_PIPES_NBR   15

◆ USBH_DEVICE_ADDRESS_DEFAULT

#define USBH_DEVICE_ADDRESS_DEFAULT   0

◆ USBH_MAX_ERROR_COUNT

#define USBH_MAX_ERROR_COUNT   2

◆ USBH_DEVICE_ADDRESS

#define USBH_DEVICE_ADDRESS   1
uint8_t
const uint8_t[]
Definition: 404_html.c:3