Prusa MINI Firmware overview
|
Go to the documentation of this file.
57 #define USB_LEN_DEV_QUALIFIER_DESC 0x0A
58 #define USB_LEN_DEV_DESC 0x12
59 #define USB_LEN_CFG_DESC 0x09
60 #define USB_LEN_IF_DESC 0x09
61 #define USB_LEN_EP_DESC 0x07
62 #define USB_LEN_OTG_DESC 0x03
63 #define USB_LEN_LANGID_STR_DESC 0x04
64 #define USB_LEN_OTHER_SPEED_DESC_SIZ 0x09
66 #define USBD_IDX_LANGID_STR 0x00
67 #define USBD_IDX_MFC_STR 0x01
68 #define USBD_IDX_PRODUCT_STR 0x02
69 #define USBD_IDX_SERIAL_STR 0x03
70 #define USBD_IDX_CONFIG_STR 0x04
71 #define USBD_IDX_INTERFACE_STR 0x05
73 #define USB_REQ_TYPE_STANDARD 0x00
74 #define USB_REQ_TYPE_CLASS 0x20
75 #define USB_REQ_TYPE_VENDOR 0x40
76 #define USB_REQ_TYPE_MASK 0x60
78 #define USB_REQ_RECIPIENT_DEVICE 0x00
79 #define USB_REQ_RECIPIENT_INTERFACE 0x01
80 #define USB_REQ_RECIPIENT_ENDPOINT 0x02
81 #define USB_REQ_RECIPIENT_MASK 0x03
83 #define USB_REQ_GET_STATUS 0x00
84 #define USB_REQ_CLEAR_FEATURE 0x01
85 #define USB_REQ_SET_FEATURE 0x03
86 #define USB_REQ_SET_ADDRESS 0x05
87 #define USB_REQ_GET_DESCRIPTOR 0x06
88 #define USB_REQ_SET_DESCRIPTOR 0x07
89 #define USB_REQ_GET_CONFIGURATION 0x08
90 #define USB_REQ_SET_CONFIGURATION 0x09
91 #define USB_REQ_GET_INTERFACE 0x0A
92 #define USB_REQ_SET_INTERFACE 0x0B
93 #define USB_REQ_SYNCH_FRAME 0x0C
95 #define USB_DESC_TYPE_DEVICE 1
96 #define USB_DESC_TYPE_CONFIGURATION 2
97 #define USB_DESC_TYPE_STRING 3
98 #define USB_DESC_TYPE_INTERFACE 4
99 #define USB_DESC_TYPE_ENDPOINT 5
100 #define USB_DESC_TYPE_DEVICE_QUALIFIER 6
101 #define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION 7
102 #define USB_DESC_TYPE_BOS 0x0F
104 #define USB_CONFIG_REMOTE_WAKEUP 2
105 #define USB_CONFIG_SELF_POWERED 1
107 #define USB_FEATURE_EP_HALT 0
108 #define USB_FEATURE_REMOTE_WAKEUP 1
109 #define USB_FEATURE_TEST_MODE 2
111 #define USB_DEVICE_CAPABITY_TYPE 0x10
113 #define USB_HS_MAX_PACKET_SIZE 512
114 #define USB_FS_MAX_PACKET_SIZE 64
115 #define USB_MAX_EP0_SIZE 64
118 #define USBD_STATE_DEFAULT 1
119 #define USBD_STATE_ADDRESSED 2
120 #define USBD_STATE_CONFIGURED 3
121 #define USBD_STATE_SUSPENDED 4
125 #define USBD_EP0_IDLE 0
126 #define USBD_EP0_SETUP 1
127 #define USBD_EP0_DATA_IN 2
128 #define USBD_EP0_DATA_OUT 3
129 #define USBD_EP0_STATUS_IN 4
130 #define USBD_EP0_STATUS_OUT 5
131 #define USBD_EP0_STALL 6
133 #define USBD_EP_TYPE_CTRL 0
134 #define USBD_EP_TYPE_ISOC 1
135 #define USBD_EP_TYPE_BULK 2
136 #define USBD_EP_TYPE_INTR 3
179 #if (USBD_SUPPORT_USER_STRING == 1)
210 #if (USBD_LPM_ENABLED == 1)
260 #define SWAPBYTE(addr) (((uint16_t)(*((uint8_t *)(addr)))) + \
261 (((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8))
263 #define LOBYTE(x) ((uint8_t)(x & 0x00FF))
264 #define HIBYTE(x) ((uint8_t)((x & 0xFF00) >>8))
265 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
266 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
269 #if defined ( __GNUC__ )
271 #define __weak __attribute__((weak))
274 #define __packed __attribute__((__packed__))
282 #if defined (__GNUC__)
283 #define __ALIGN_END __attribute__ ((aligned (4)))
284 #define __ALIGN_BEGIN
287 #if defined (__CC_ARM)
288 #define __ALIGN_BEGIN __align(4)
289 #elif defined (__ICCARM__)
290 #define __ALIGN_BEGIN
291 #elif defined (__TASKING__)
292 #define __ALIGN_BEGIN __align(4)
Definition: usbd_def.h:189
uint8_t(* DeInit)(struct _USBD_HandleTypeDef *pdev, uint8_t cfgidx)
Definition: usbd_def.h:163
uint8_t dev_old_state
Definition: usbd_def.h:237
uint8_t(* SOF)(struct _USBD_HandleTypeDef *pdev)
Definition: usbd_def.h:171
uint32_t status
Definition: usbd_def.h:218
Definition: usbd_def.h:201
uint16_t wLength
Definition: usbd_def.h:155
USBD_SetupReqTypedef request
Definition: usbd_def.h:243
uint8_t(* Setup)(struct _USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
Definition: usbd_def.h:165
USBD_ClassTypeDef * pClass
Definition: usbd_def.h:245
Definition: usbd_def.h:190
Definition: usbd_def.h:197
uint8_t(* DataOut)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum)
Definition: usbd_def.h:170
uint8_t dev_state
Definition: usbd_def.h:236
uint32_t ep0_state
Definition: usbd_def.h:234
USBD_EndpointTypeDef ep_in[15]
Definition: usbd_def.h:232
USBD_DescriptorsTypeDef * pDesc
Definition: usbd_def.h:244
uint8_t bmRequest
Definition: usbd_def.h:151
uint32_t ep0_data_len
Definition: usbd_def.h:235
void * pClassData
Definition: usbd_def.h:246
uint32_t dev_config
Definition: usbd_def.h:228
uint8_t(* IsoINIncomplete)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum)
Definition: usbd_def.h:172
Definition: usbd_def.h:225
void * pData
Definition: usbd_def.h:248
Definition: usbd_def.h:216
uint32_t dev_remote_wakeup
Definition: usbd_def.h:241
uint32_t dev_config_status
Definition: usbd_def.h:230
Definition: usbd_def.h:160
uint8_t(* EP0_RxReady)(struct _USBD_HandleTypeDef *pdev)
Definition: usbd_def.h:167
uint32_t rem_length
Definition: usbd_def.h:220
uint8_t(* DataIn)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum)
Definition: usbd_def.h:169
uint16_t wIndex
Definition: usbd_def.h:154
uint8_t(* Init)(struct _USBD_HandleTypeDef *pdev, uint8_t cfgidx)
Definition: usbd_def.h:162
Definition: usbd_def.h:196
Definition: usbd_def.h:188
uint8_t id
Definition: usbd_def.h:227
const uint8_t[]
Definition: 404_html.c:3
Definition: usbd_def.h:148
USBD_SpeedTypeDef dev_speed
Definition: usbd_def.h:231
struct _Device_cb USBD_ClassTypeDef
uint16_t wValue
Definition: usbd_def.h:153
USBD_EndpointTypeDef ep_out[15]
Definition: usbd_def.h:233
uint8_t dev_test_mode
Definition: usbd_def.h:240
struct usb_setup_req USBD_SetupReqTypedef
USBD_StatusTypeDef
Definition: usbd_def.h:194
uint8_t bRequest
Definition: usbd_def.h:152
struct _USBD_HandleTypeDef USBD_HandleTypeDef
uint8_t dev_connection_status
Definition: usbd_def.h:239
uint8_t(* IsoOUTIncomplete)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum)
Definition: usbd_def.h:173
void * pUserData
Definition: usbd_def.h:247
USBD_SpeedTypeDef
Definition: usbd_def.h:186
png_uint_32 length
Definition: png.c:2247
uint8_t dev_address
Definition: usbd_def.h:238
uint8_t(* EP0_TxSent)(struct _USBD_HandleTypeDef *pdev)
Definition: usbd_def.h:166
uint32_t dev_default_config
Definition: usbd_def.h:229
: Header for usbd_conf.c file.
Definition: usbd_def.h:195
uint32_t maxpacket
Definition: usbd_def.h:221
uint32_t total_length
Definition: usbd_def.h:219