Prusa MINI Firmware overview
|
|
USBH_StatusTypeDef | USBH_Get_DevDesc (USBH_HandleTypeDef *phost, uint8_t length) |
| USBH_Get_DevDesc Issue Get Device Descriptor command to the device. Once the response received, it parses the device descriptor and updates the status. More...
|
|
USBH_StatusTypeDef | USBH_Get_CfgDesc (USBH_HandleTypeDef *phost, uint16_t length) |
| USBH_Get_CfgDesc Issues Configuration Descriptor to the device. Once the response received, it parses the configuration descriptor and updates the status. More...
|
|
USBH_StatusTypeDef | USBH_Get_StringDesc (USBH_HandleTypeDef *phost, uint8_t string_index, uint8_t *buff, uint16_t length) |
| USBH_Get_StringDesc Issues string Descriptor command to the device. Once the response received, it parses the string descriptor and updates the status. More...
|
|
USBH_StatusTypeDef | USBH_GetDescriptor (USBH_HandleTypeDef *phost, uint8_t req_type, uint16_t value_idx, uint8_t *buff, uint16_t length) |
| USBH_GetDescriptor Issues Descriptor command to the device. Once the response received, it parses the descriptor and updates the status. More...
|
|
USBH_StatusTypeDef | USBH_SetAddress (USBH_HandleTypeDef *phost, uint8_t DeviceAddress) |
| USBH_SetAddress This command sets the address to the connected device. More...
|
|
USBH_StatusTypeDef | USBH_SetCfg (USBH_HandleTypeDef *phost, uint16_t cfg_idx) |
| USBH_SetCfg The command sets the configuration value to the connected device. More...
|
|
USBH_StatusTypeDef | USBH_SetInterface (USBH_HandleTypeDef *phost, uint8_t ep_num, uint8_t altSetting) |
| USBH_SetInterface The command sets the Interface value to the connected device. More...
|
|
USBH_StatusTypeDef | USBH_ClrFeature (USBH_HandleTypeDef *phost, uint8_t ep_num) |
| USBH_ClrFeature This request is used to clear or disable a specific feature. More...
|
|
USBH_DescHeader_t * | USBH_GetNextDesc (uint8_t *pbuf, uint16_t *ptr) |
| USBH_GetNextDesc This function return the next descriptor header. More...
|
|
USBH_StatusTypeDef | USBH_CtlReq (USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length) |
| USBH_CtlReq USBH_CtlReq sends a control request and provide the status after completion of the request. More...
|
|
static void | USBH_ParseDevDesc (USBH_DevDescTypeDef *dev_desc, uint8_t *buf, uint16_t length) |
| USBH_ParseDevDesc This function Parses the device descriptor. More...
|
|
static void | USBH_ParseCfgDesc (USBH_CfgDescTypeDef *cfg_desc, uint8_t *buf, uint16_t length) |
| USBH_ParseCfgDesc This function Parses the configuration descriptor. More...
|
|
static void | USBH_ParseInterfaceDesc (USBH_InterfaceDescTypeDef *if_descriptor, uint8_t *buf) |
| USBH_ParseInterfaceDesc This function Parses the interface descriptor. More...
|
|
static void | USBH_ParseEPDesc (USBH_EpDescTypeDef *ep_descriptor, uint8_t *buf) |
| USBH_ParseEPDesc This function Parses the endpoint descriptor. More...
|
|
static void | USBH_ParseStringDesc (uint8_t *psrc, uint8_t *pdest, uint16_t length) |
| USBH_ParseStringDesc This function Parses the string descriptor. More...
|
|
static USBH_StatusTypeDef | USBH_HandleControl (USBH_HandleTypeDef *phost) |
| USBH_HandleControl Handles the USB control transfer state machine. More...
|
|
◆ USBH_Get_DevDesc()
USBH_Get_DevDesc Issue Get Device Descriptor command to the device. Once the response received, it parses the device descriptor and updates the status.
- Parameters
-
phost | Host Handle |
length | Length of the descriptor |
- Return values
-
◆ USBH_Get_CfgDesc()
USBH_Get_CfgDesc Issues Configuration Descriptor to the device. Once the response received, it parses the configuration descriptor and updates the status.
- Parameters
-
phost | Host Handle |
length | Length of the descriptor |
- Return values
-
143 #if (USBH_KEEP_CFG_DESCRIPTOR == 1)
144 pData = phost->
device.CfgDesc_Raw;
◆ USBH_Get_StringDesc()
USBH_Get_StringDesc Issues string Descriptor command to the device. Once the response received, it parses the string descriptor and updates the status.
- Parameters
-
phost | Host Handle |
string_index | String index for the descriptor |
buff | Buffer address for the descriptor |
length | Length of the descriptor |
- Return values
-
◆ USBH_GetDescriptor()
USBH_GetDescriptor Issues Descriptor command to the device. Once the response received, it parses the descriptor and updates the status.
- Parameters
-
phost | Host Handle |
req_type | Descriptor type |
value_idx | Value for the GetDescriptr request |
buff | Buffer to store the descriptor |
length | Length of the descriptor |
- Return values
-
◆ USBH_SetAddress()
USBH_SetAddress This command sets the address to the connected device.
- Parameters
-
phost | Host Handle |
DeviceAddress | Device address to assign |
- Return values
-
242 USB_REQ_TYPE_STANDARD;
◆ USBH_SetCfg()
USBH_SetCfg The command sets the configuration value to the connected device.
- Parameters
-
phost | Host Handle |
cfg_idx | Configuration value |
- Return values
-
266 USB_REQ_TYPE_STANDARD;
◆ USBH_SetInterface()
USBH_SetInterface The command sets the Interface value to the connected device.
- Parameters
-
phost | Host Handle |
altSetting | Interface value |
- Return values
-
290 USB_REQ_TYPE_STANDARD;
◆ USBH_ClrFeature()
USBH_ClrFeature This request is used to clear or disable a specific feature.
- Parameters
-
phost | Host Handle |
ep_num | endpoint number |
hc_num | Host channel number |
- Return values
-
◆ USBH_GetNextDesc()
USBH_GetNextDesc This function return the next descriptor header.
- Parameters
-
buf | Buffer where the cfg descriptor is available |
ptr | data pointer inside the cfg descriptor |
- Return values
-
◆ USBH_CtlReq()
USBH_CtlReq USBH_CtlReq sends a control request and provide the status after completion of the request.
- Parameters
-
phost | Host Handle |
req | Setup Request Structure |
buff | data buffer address to store the response |
length | length of the response |
- Return values
-
547 #if (USBH_USE_OS == 1)
◆ USBH_ParseDevDesc()
USBH_ParseDevDesc This function Parses the device descriptor.
- Parameters
-
dev_desc | device_descriptor destination address |
buf | Buffer where the source descriptor is available |
length | Length of the descriptor |
- Return values
-
◆ USBH_ParseCfgDesc()
USBH_ParseCfgDesc This function Parses the configuration descriptor.
- Parameters
-
cfg_desc | Configuration Descriptor address |
buf | Buffer where the source descriptor is available |
length | Length of the descriptor |
- Return values
-
406 while ((ep_ix < pif->bNumEndpoints) && (ptr < cfg_desc->
wTotalLength))
◆ USBH_ParseInterfaceDesc()
USBH_ParseInterfaceDesc This function Parses the interface descriptor.
- Parameters
-
if_descriptor | : Interface descriptor destination |
buf | Buffer where the descriptor data is available |
- Return values
-
◆ USBH_ParseEPDesc()
USBH_ParseEPDesc This function Parses the endpoint descriptor.
- Parameters
-
ep_descriptor | Endpoint descriptor destination address |
buf | Buffer where the parsed descriptor stored |
- Return values
-
◆ USBH_ParseStringDesc()
USBH_ParseStringDesc This function Parses the string descriptor.
- Parameters
-
psrc | Source pointer containing the descriptor data |
pdest | Destination address pointer |
length | Length of the descriptor |
- Return values
-
490 strlength = ( ( (psrc[0]-2) <=
length) ? (psrc[0]-2) :
length);
493 for (idx = 0; idx < strlength; idx+=2 )
◆ USBH_HandleControl()
USBH_HandleControl Handles the USB control transfer state machine.
- Parameters
-
- Return values
-
635 #if (USBH_USE_OS == 1)
642 #if (USBH_USE_OS == 1)
667 #if (USBH_USE_OS == 1)
677 #if (USBH_USE_OS == 1)
685 #if (USBH_USE_OS == 1)
709 #if (USBH_USE_OS == 1)
720 #if (USBH_USE_OS == 1)
729 #if (USBH_USE_OS == 1)
739 #if (USBH_USE_OS == 1)
765 #if (USBH_USE_OS == 1)
773 #if (USBH_USE_OS == 1)
782 #if (USBH_USE_OS == 1)
806 #if (USBH_USE_OS == 1)
814 #if (USBH_USE_OS == 1)
822 #if (USBH_USE_OS == 1)
Definition: usbh_def.h:381
Definition: usbh_def.h:389
#define USB_REQ_SET_ADDRESS
Definition: usbd_def.h:86
uint16_t idVendor
Definition: usbh_def.h:249
#define USB_DESC_TYPE_STRING
Definition: usbd_def.h:97
USB_Setup_TypeDef setup
Definition: usbh_def.h:412
#define USB_REQ_SET_CONFIGURATION
Definition: usbd_def.h:90
uint8_t direction
Definition: UsbCore.h:185
Definition: usbh_def.h:362
uint8_t * buff
Definition: usbh_def.h:409
Definition: usbh_def.h:371
uint8_t bDeviceClass
Definition: usbh_def.h:242
Definition: usbh_def.h:367
uint8_t bLength
Definition: usbh_def.h:288
uint8_t bNumEndpoints
Definition: usbh_def.h:276
#define USB_DESC_TYPE_ENDPOINT
Definition: usbd_def.h:99
Definition: usbh_def.h:365
Definition: usbh_def.h:387
USBH_InterfaceDescTypeDef Itf_Desc[USBH_MAX_NUM_INTERFACES]
Definition: usbh_def.h:296
uint8_t bRequest
Definition: usbh_def.h:222
static USBH_StatusTypeDef USBH_HandleControl(USBH_HandleTypeDef *phost)
USBH_HandleControl Handles the USB control transfer state machine.
Definition: usbh_ctlreq.c:581
USBH_EpDescTypeDef Ep_Desc[USBH_MAX_NUM_ENDPOINTS]
Definition: usbh_def.h:281
CMD_StateTypeDef RequestState
Definition: usbh_def.h:454
uint8_t Data[USBH_MAX_DATA_BUFFER]
Definition: usbh_def.h:424
#define USB_REQ_CLEAR_FEATURE
Definition: usbd_def.h:84
USBH_DevDescTypeDef DevDesc
Definition: usbh_def.h:429
uint8_t bInterfaceNumber
Definition: usbh_def.h:274
#define USBH_ErrLog(...)
Definition: usbh_conf.h:176
uint16_t_uint8_t wIndex
Definition: usbh_def.h:224
Definition: usbh_def.h:386
uint16_t length
Definition: usbh_def.h:410
uint8_t bConfigurationValue
Definition: usbh_def.h:292
static void USBH_ParseDevDesc(USBH_DevDescTypeDef *, uint8_t *buf, uint16_t length)
USBH_ParseDevDesc This function Parses the device descriptor.
Definition: usbh_ctlreq.c:333
USBH_StatusTypeDef USBH_CtlSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num, uint8_t do_ping)
USBH_CtlSendData Sends a data Packet to the Device.
Definition: usbh_ioreq.c:126
uint16_t bcdDevice
Definition: usbh_def.h:251
#define USB_CONFIGURATION_DESC_SIZE
Definition: usbh_def.h:151
uint16_t bcdUSB
Definition: usbh_def.h:241
static void USBH_ParseEPDesc(USBH_EpDescTypeDef *ep_descriptor, uint8_t *buf)
USBH_ParseEPDesc This function Parses the endpoint descriptor.
Definition: usbh_ctlreq.c:452
uint8_t bDeviceProtocol
Definition: usbh_def.h:244
__IO uint32_t Timer
Definition: usbh_def.h:461
Definition: usbh_def.h:363
uint8_t iManufacturer
Definition: usbh_def.h:252
#define USB_REQ_SET_INTERFACE
Definition: usbd_def.h:92
USBH_CtrlTypeDef Control
Definition: usbh_def.h:455
Definition: usbh_def.h:385
uint16_t_uint8_t wValue
Definition: usbh_def.h:223
Definition: usbh_def.h:270
USBH_StatusTypeDef USBH_LL_Stop(USBH_HandleTypeDef *phost)
Stop the low level portion of the host driver.
Definition: usbh_conf.c:283
#define USB_DESC_STRING
Definition: usbh_def.h:160
#define USB_REQ_RECIPIENT_DEVICE
Definition: usbd_def.h:78
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usbd_def.h:79
USBH_StatusTypeDef USBH_CtlReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num)
USBH_CtlReceiveData Receives the Device Response to the Setup Packet.
Definition: usbh_ioreq.c:159
Definition: usbh_def.h:364
#define USB_REQ_GET_DESCRIPTOR
Definition: usbd_def.h:87
Definition: usbh_def.h:259
USBH_CfgDescTypeDef CfgDesc
Definition: usbh_def.h:430
#define FEATURE_SELECTOR_ENDPOINT
Definition: usbh_ctlreq.h:57
uint8_t bNumConfigurations
Definition: usbh_def.h:255
uint8_t bDescriptorType
Definition: usbh_def.h:289
Definition: usbh_def.h:380
uint16_t_uint8_t wLength
Definition: usbh_def.h:225
Definition: usbh_def.h:372
Definition: usbh_def.h:304
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
Definition: cmsis_os.c:1113
Definition: usbh_def.h:368
USBH_DeviceTypeDef device
Definition: usbh_def.h:456
Definition: usbh_def.h:361
Definition: usbh_def.h:397
CTRL_StateTypeDef state
Definition: usbh_def.h:413
uint8_t bmAttributes
Definition: usbh_def.h:264
uint8_t iProduct
Definition: usbh_def.h:253
uint8_t bMaxPacketSize
Definition: usbh_def.h:248
Definition: usbh_def.h:390
uint8_t bNumInterfaces
Definition: usbh_def.h:291
uint8_t bLength
Definition: usbh_def.h:239
USBH_URBStateTypeDef USBH_LL_GetURBState(USBH_HandleTypeDef *phost, uint8_t)
Get a URB state from the low level driver.
Definition: usbh_conf.c:519
uint8_t pipe_in
Definition: usbh_def.h:406
uint8_t iConfiguration
Definition: usbh_def.h:293
static void USBH_ParseStringDesc(uint8_t *psrc, uint8_t *pdest, uint16_t length)
USBH_ParseStringDesc This function Parses the string descriptor.
Definition: usbh_ctlreq.c:472
const uint8_t[]
Definition: 404_html.c:3
Definition: usbh_def.h:366
static void USBH_ParseCfgDesc(USBH_CfgDescTypeDef *cfg_desc, uint8_t *buf, uint16_t length)
USBH_ParseCfgDesc This function Parses the configuration descriptor.
Definition: usbh_ctlreq.c:366
USBH_StatusTypeDef USBH_CtlReq(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length)
USBH_CtlReq USBH_CtlReq sends a control request and provide the status after completion of the reques...
Definition: usbh_ctlreq.c:531
uint8_t bDescriptorType
Definition: usbh_def.h:262
struct _USB_Setup::_SetupPkt_Struc b
USBH_StatusTypeDef
Definition: usbh_def.h:302
uint16_t idProduct
Definition: usbh_def.h:250
Definition: usbh_def.h:360
uint8_t bMaxPower
Definition: usbh_def.h:295
uint8_t bInterfaceProtocol
Definition: usbh_def.h:279
uint8_t bInterfaceSubClass
Definition: usbh_def.h:278
uint8_t bDeviceSubClass
Definition: usbh_def.h:243
uint16_t timer
Definition: usbh_def.h:411
uint8_t errorcount
Definition: usbh_def.h:414
uint8_t bLength
Definition: usbh_def.h:232
static status_t status
Definition: filament_sensor.c:37
#define USB_H2D
Definition: usbh_def.h:108
USBH_StatusTypeDef USBH_CtlSendSetup(USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t hc_num)
USBH_CtlSendSetup Sends the Setup Packet to the Device.
Definition: usbh_ioreq.c:100
uint8_t pipe_out
Definition: usbh_def.h:407
uint8_t iInterface
Definition: usbh_def.h:280
Definition: usbh_def.h:359
uint16_t w
Definition: usbh_def.h:204
uint8_t iSerialNumber
Definition: usbh_def.h:254
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usbd_def.h:80
USBH_DescHeader_t * USBH_GetNextDesc(uint8_t *pbuf, uint16_t *ptr)
USBH_GetNextDesc This function return the next descriptor header.
Definition: usbh_ctlreq.c:509
USBH_StatusTypeDef USBH_GetDescriptor(USBH_HandleTypeDef *phost, uint8_t req_type, uint16_t value_idx, uint8_t *buff, uint16_t length)
USBH_GetDescriptor Issues Descriptor command to the device. Once the response received,...
Definition: usbh_ctlreq.c:204
#define USB_DESC_TYPE_INTERFACE
Definition: usbd_def.h:98
Definition: usbh_def.h:306
#define USB_D2H
Definition: usbh_def.h:109
Definition: usbh_def.h:305
#define USB_DESC_CONFIGURATION
Definition: usbh_def.h:159
uint16_t wTotalLength
Definition: usbh_def.h:290
#define USB_DESC_DEVICE
Definition: usbh_def.h:158
uint8_t bDescriptorType
Definition: usbh_def.h:233
#define USBH_MAX_ERROR_COUNT
Definition: usbh_def.h:184
uint8_t bInterval
Definition: usbh_def.h:266
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
Definition: usbh_def.h:464
#define USBH_MAX_NUM_INTERFACES
Definition: usbh_conf.h:102
#define USB_REQ_TYPE_STANDARD
Definition: usbd_def.h:73
png_uint_32 length
Definition: png.c:2247
uint8_t bDescriptorType
Definition: usbh_def.h:273
USBH_URBStateTypeDef
Definition: usbh_def.h:384
uint8_t bmRequestType
Definition: usbh_def.h:221
uint8_t bLength
Definition: usbh_def.h:261
static void USBH_ParseInterfaceDesc(USBH_InterfaceDescTypeDef *if_descriptor, uint8_t *buf)
USBH_ParseInterfaceDesc This function Parses the interface descriptor.
Definition: usbh_ctlreq.c:431
uint8_t bmAttributes
Definition: usbh_def.h:294
#define LE16(addr)
Definition: usbh_def.h:69
#define HOST_USER_UNRECOVERED_ERROR
Definition: usbh_core.h:69
uint8_t bDescriptorType
Definition: usbh_def.h:240
uint8_t bAlternateSetting
Definition: usbh_def.h:275
uint16_t wMaxPacketSize
Definition: usbh_def.h:265
#define USB_REQ_DIR_MASK
Definition: usbh_def.h:107
uint8_t bEndpointAddress
Definition: usbh_def.h:263
Definition: usbh_def.h:307
#define USB_LEN_CFG_DESC
Definition: usbd_def.h:59
uint32_t d8[2]
Definition: usbh_def.h:217
uint8_t bLength
Definition: usbh_def.h:272
uint8_t bInterfaceClass
Definition: usbh_def.h:277
Definition: usbh_def.h:369
Definition: usbh_def.h:370