Prusa MINI Firmware overview
|
|
USBH_StatusTypeDef | USBH_Init (USBH_HandleTypeDef *phost, void(*pUsrFunc)(USBH_HandleTypeDef *phost, uint8_t), uint8_t id) |
| HCD_Init Initialize the HOST Core. More...
|
|
USBH_StatusTypeDef | USBH_DeInit (USBH_HandleTypeDef *phost) |
| HCD_Init De-Initialize the Host portion of the driver. More...
|
|
USBH_StatusTypeDef | USBH_RegisterClass (USBH_HandleTypeDef *phost, USBH_ClassTypeDef *pclass) |
| USBH_RegisterClass Link class driver to Host Core. More...
|
|
USBH_StatusTypeDef | USBH_SelectInterface (USBH_HandleTypeDef *phost, uint8_t interface) |
| USBH_SelectInterface Select current interface. More...
|
|
uint8_t | USBH_FindInterface (USBH_HandleTypeDef *phost, uint8_t Class, uint8_t SubClass, uint8_t Protocol) |
| USBH_FindInterface Find the interface index for a specific class. More...
|
|
uint8_t | USBH_GetActiveClass (USBH_HandleTypeDef *phost) |
| USBH_GetActiveClass Return Device Class. More...
|
|
uint8_t | USBH_FindInterfaceIndex (USBH_HandleTypeDef *phost, uint8_t interface_number, uint8_t alt_settings) |
| USBH_FindInterfaceIndex Find the interface index for a specific class interface and alternate setting number. More...
|
|
USBH_StatusTypeDef | USBH_Start (USBH_HandleTypeDef *phost) |
| USBH_Start Start the USB Host Core. More...
|
|
USBH_StatusTypeDef | USBH_Stop (USBH_HandleTypeDef *phost) |
| USBH_Stop Stop the USB Host Core. More...
|
|
USBH_StatusTypeDef | USBH_Process (USBH_HandleTypeDef *phost) |
| USBH_Process Background process of the USB Core. More...
|
|
USBH_StatusTypeDef | USBH_ReEnumerate (USBH_HandleTypeDef *phost) |
| HCD_ReEnumerate Perform a new Enumeration phase. More...
|
|
USBH_StatusTypeDef | USBH_LL_Init (USBH_HandleTypeDef *phost) |
| Initialize the low level portion of the host driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_DeInit (USBH_HandleTypeDef *phost) |
| De-Initialize the low level portion of the host driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_Start (USBH_HandleTypeDef *phost) |
| Start the low level portion of the host driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_Stop (USBH_HandleTypeDef *phost) |
| Stop the low level portion of the host driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_Connect (USBH_HandleTypeDef *phost) |
| USBH_LL_Connect Handle USB Host connexion event. More...
|
|
USBH_StatusTypeDef | USBH_LL_Disconnect (USBH_HandleTypeDef *phost) |
| USBH_LL_Disconnect Handle USB Host disconnection event. More...
|
|
USBH_SpeedTypeDef | USBH_LL_GetSpeed (USBH_HandleTypeDef *phost) |
| Return the USB host speed from the low level driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_ResetPort (USBH_HandleTypeDef *phost) |
| Reset the Host port of the low level driver. More...
|
|
uint32_t | USBH_LL_GetLastXferSize (USBH_HandleTypeDef *phost, uint8_t) |
| Return the last transfered packet size. More...
|
|
USBH_StatusTypeDef | USBH_LL_DriverVBUS (USBH_HandleTypeDef *phost, uint8_t) |
| Drive VBUS. More...
|
|
USBH_StatusTypeDef | USBH_LL_OpenPipe (USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t) |
| Open a pipe of the low level driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_ClosePipe (USBH_HandleTypeDef *phost, uint8_t) |
| Close a pipe of the low level driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_SubmitURB (USBH_HandleTypeDef *phost, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t *, uint16_t, uint8_t) |
| Submit a new URB to the low level driver. More...
|
|
USBH_URBStateTypeDef | USBH_LL_GetURBState (USBH_HandleTypeDef *phost, uint8_t) |
| Get a URB state from the low level driver. More...
|
|
USBH_StatusTypeDef | USBH_LL_SetToggle (USBH_HandleTypeDef *phost, uint8_t, uint8_t) |
| Set toggle for a pipe. More...
|
|
uint8_t | USBH_LL_GetToggle (USBH_HandleTypeDef *phost, uint8_t) |
| Return the current toggle of a pipe. More...
|
|
void | USBH_Delay (uint32_t Delay) |
| Delay routine for the USB Host Library. More...
|
|
void | USBH_LL_SetTimer (USBH_HandleTypeDef *phost, uint32_t) |
| USBH_LL_SetTimer Set the initial Host Timer tick. More...
|
|
void | USBH_LL_IncTimer (USBH_HandleTypeDef *phost) |
| USBH_LL_IncTimer Increment Host Timer tick. More...
|
|
◆ USBH_Init()
HCD_Init Initialize the HOST Core.
- Parameters
-
phost | Host Handle |
pUsrFunc | User Callback |
- Return values
-
114 phost->
pUser = pUsrFunc;
117 #if (USBH_USE_OS == 1)
124 #if defined (USBH_PROCESS_STACK_SIZE)
◆ USBH_DeInit()
HCD_Init De-Initialize the Host portion of the driver.
- Parameters
-
- Return values
-
◆ USBH_RegisterClass()
USBH_RegisterClass Link class driver to Host Core.
- Parameters
-
phost | : Host Handle |
pclass | Class handle |
- Return values
-
◆ USBH_SelectInterface()
USBH_SelectInterface Select current interface.
- Parameters
-
phost | Host Handle |
interface | Interface number |
- Return values
-
237 if(interface < phost->device.CfgDesc.bNumInterfaces)
240 USBH_UsrLog (
"Switching to Interface (#%d)", interface);
◆ USBH_FindInterface()
USBH_FindInterface Find the interface index for a specific class.
- Parameters
-
phost | Host Handle |
Class | Class code |
SubClass | SubClass code |
Protocol | Protocol code |
- Return values
-
interface | index in the configuration structure |
- Note
- : (1)interface index 0xFF means interface index not found
◆ USBH_GetActiveClass()
USBH_GetActiveClass Return Device Class.
- Parameters
-
phost | Host Handle |
interface | Interface index |
- Return values
-
◆ USBH_FindInterfaceIndex()
USBH_FindInterfaceIndex Find the interface index for a specific class interface and alternate setting number.
- Parameters
-
phost | Host Handle |
interface_number | interface number |
alt_settings | : alternate setting number |
- Return values
-
interface | index in the configuration structure |
- Note
- : (1)interface index 0xFF means interface index not found
◆ USBH_Start()
USBH_Start Start the USB Host Core.
- Parameters
-
- Return values
-
◆ USBH_Stop()
USBH_Stop Stop the USB Host Core.
- Parameters
-
- Return values
-
◆ USBH_Process()
USBH_Process Background process of the USB Core.
- Parameters
-
- Return values
-
412 #if (USBH_USE_OS == 1)
454 #if (USBH_USE_OS == 1)
469 USBH_UsrLog (
"This device has only 1 configuration.");
489 #if (USBH_USE_OS == 1)
544 USBH_UsrLog (
"No registered class for this device.");
548 #if (USBH_USE_OS == 1)
569 #if (USBH_USE_OS == 1)
◆ USBH_ReEnumerate()
HCD_ReEnumerate Perform a new Enumeration phase.
- Parameters
-
- Return values
-
385 #if (USBH_USE_OS == 1)
◆ USBH_LL_Init()
Initialize the low level portion of the host driver.
- Parameters
-
- Return values
-
◆ USBH_LL_DeInit()
De-Initialize the low level portion of the host driver.
- Parameters
-
- Return values
-
227 hal_status = HAL_HCD_DeInit(phost->
pData);
229 switch (hal_status) {
◆ USBH_LL_Start()
Start the low level portion of the host driver.
- Parameters
-
- Return values
-
258 hal_status = HAL_HCD_Start(phost->
pData);
260 switch (hal_status) {
◆ USBH_LL_Stop()
Stop the low level portion of the host driver.
- Parameters
-
- Return values
-
289 hal_status = HAL_HCD_Stop(phost->
pData);
291 switch (hal_status) {
◆ USBH_LL_Connect()
USBH_LL_Connect Handle USB Host connexion event.
- Parameters
-
- Return values
-
841 #if (USBH_USE_OS == 1)
◆ USBH_LL_Disconnect()
USBH_LL_Disconnect Handle USB Host disconnection event.
- Parameters
-
- Return values
-
876 #if (USBH_USE_OS == 1)
◆ USBH_LL_GetSpeed()
Return the USB host speed from the low level driver.
- Parameters
-
- Return values
-
319 switch (HAL_HCD_GetCurrentSpeed(phost->
pData)) {
◆ USBH_LL_ResetPort()
Reset the Host port of the low level driver.
- Parameters
-
- Return values
-
348 hal_status = HAL_HCD_ResetPort(phost->
pData);
349 switch (hal_status) {
◆ USBH_LL_GetLastXferSize()
Return the last transfered packet size.
- Parameters
-
phost | Host handle |
pipe | Pipe index |
- Return values
-
◆ USBH_LL_DriverVBUS()
Drive VBUS.
- Parameters
-
phost | Host handle |
state | : VBUS state This parameter can be one of the these values: 0 : VBUS Active 1 : VBUS Inactive |
- Return values
-
◆ USBH_LL_OpenPipe()
Open a pipe of the low level driver.
- Parameters
-
phost | Host handle |
pipe_num | Pipe index |
epnum | Endpoint number |
dev_address | Device USB address |
speed | Device Speed |
ep_type | Endpoint type |
mps | Endpoint max packet size |
- Return values
-
395 hal_status = HAL_HCD_HC_Init(phost->
pData, pipe_num, epnum,
396 dev_address, speed, ep_type, mps);
398 switch (hal_status) {
◆ USBH_LL_ClosePipe()
Close a pipe of the low level driver.
- Parameters
-
phost | Host handle |
pipe | Pipe index |
- Return values
-
428 hal_status = HAL_HCD_HC_Halt(phost->
pData, pipe);
430 switch (hal_status) {
◆ USBH_LL_SubmitURB()
Submit a new URB to the low level driver.
- Parameters
-
phost | Host handle |
pipe | Pipe index This parameter can be a value from 1 to 15 |
direction | : Channel number This parameter can be one of the these values: 0 : Output 1 : Input |
ep_type | : Endpoint Type This parameter can be one of the these values:
- EP_TYPE_CTRL: Control type
- EP_TYPE_ISOC: Isochrounous type
- EP_TYPE_BULK: Bulk type
- EP_TYPE_INTR: Interrupt type
|
token | : Endpoint Type This parameter can be one of the these values:
|
pbuff | : pointer to URB data |
length | : Length of URB data |
do_ping | : activate do ping protocol (for high speed only) This parameter can be one of the these values: 0 : do ping inactive 1 : do ping active |
- Return values
-
483 hal_status = HAL_HCD_HC_SubmitRequest(phost->
pData, pipe,
direction,
484 ep_type, token, pbuff,
length,
487 switch (hal_status) {
◆ USBH_LL_GetURBState()
Get a URB state from the low level driver.
- Parameters
-
phost | Host handle |
pipe | Pipe index This parameter can be a value from 1 to 15 |
- Return values
-
URB | state This parameter can be one of the these values:
- URB_IDLE
- URB_DONE
- URB_NOTREADY
- URB_NYET
- URB_ERROR
- URB_STALL
|
◆ USBH_LL_SetToggle()
Set toggle for a pipe.
- Parameters
-
phost | Host handle |
pipe | Pipe index |
toggle | toggle (0/1) |
- Return values
-
567 HCD_HandleTypeDef *pHandle;
568 pHandle = phost->
pData;
570 if (pHandle->hc[pipe].ep_is_in) {
571 pHandle->hc[pipe].toggle_in = toggle;
573 pHandle->hc[pipe].toggle_out = toggle;
◆ USBH_LL_GetToggle()
Return the current toggle of a pipe.
- Parameters
-
phost | Host handle |
pipe | Pipe index |
- Return values
-
587 HCD_HandleTypeDef *pHandle;
588 pHandle = phost->
pData;
590 if (pHandle->hc[pipe].ep_is_in) {
591 toggle = pHandle->hc[pipe].toggle_in;
593 toggle = pHandle->hc[pipe].toggle_out;
◆ USBH_Delay()
void USBH_Delay |
( |
uint32_t |
Delay | ) |
|
Delay routine for the USB Host Library.
- Parameters
-
- Return values
-
◆ USBH_LL_SetTimer()
USBH_LL_SetTimer Set the initial Host Timer tick.
- Parameters
-
- Return values
-
◆ USBH_LL_IncTimer()
USBH_LL_IncTimer Increment Host Timer tick.
- Parameters
-
- Return values
-
uint8_t direction
Definition: UsbCore.h:185
Definition: usbh_def.h:337
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
Return the USB host speed from the low level driver.
Definition: usbh_conf.c:314
#define HOST_USER_SELECT_CONFIGURATION
Definition: usbh_core.h:64
USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t configuration_value)
USBH_SetCfg The command sets the configuration value to the connected device.
Definition: usbh_ctlreq.c:260
Definition: stm32f4xx_hal_def.h:59
#define osThreadDef(name, thread, priority, instances, stacksz)
Definition: cmsis_os.h:468
Definition: stm32f4xx_hal_def.h:57
uint8_t current_interface
Definition: usbh_def.h:428
USBH_InterfaceDescTypeDef Itf_Desc[USBH_MAX_NUM_INTERFACES]
Definition: usbh_def.h:296
static USBH_StatusTypeDef USBH_HandleEnum(USBH_HandleTypeDef *phost)
USBH_HandleEnum This function includes the complete enumeration process.
Definition: usbh_core.c:609
#define HOST_HS
Definition: usbh_conf.h:127
USBH_StatusTypeDef USBH_Start(USBH_HandleTypeDef *phost)
USBH_Start Start the USB Host Core.
Definition: usbh_core.c:333
#define HOST_USER_DISCONNECTION
Definition: usbh_core.h:68
void USBH_Delay(uint32_t Delay)
Delay routine for the USB Host Library.
Definition: usbh_conf.c:601
Definition: usbh_def.h:335
USBH_DevDescTypeDef DevDesc
Definition: usbh_def.h:429
uint8_t bInterfaceNumber
Definition: usbh_def.h:274
#define USBH_ErrLog(...)
Definition: usbh_conf.h:176
USBH_StatusTypeDef(* Requests)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:443
USBH_StatusTypeDef USBH_LL_DriverVBUS(USBH_HandleTypeDef *phost, uint8_t)
Drive VBUS.
Definition: usbh_conf.c:532
USBH_StatusTypeDef(* BgndProcess)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:444
Definition: stm32f4xx_hal_def.h:60
HCD_HandleTypeDef hhcd_USB_OTG_HS
Definition: usbh_conf.c:67
static volatile fsensor_t state
Definition: filament_sensor.c:23
uint8_t bConfigurationValue
Definition: usbh_def.h:292
Definition: usbh_def.h:331
Definition: usbh_def.h:334
__IO uint32_t Timer
Definition: usbh_def.h:461
#define HOST_USER_CONNECTION
Definition: usbh_core.h:67
Definition: usbh_def.h:333
#define NULL
Definition: usbd_def.h:53
void * pData
Definition: usbh_def.h:446
USBH_CtrlTypeDef Control
Definition: usbh_def.h:455
USBH_StatusTypeDef USBH_LL_ResetPort(USBH_HandleTypeDef *phost)
Reset the Host port of the low level driver.
Definition: usbh_conf.c:342
Definition: usbh_def.h:270
uint8_t address
Definition: usbh_def.h:425
USBH_StatusTypeDef USBH_LL_Stop(USBH_HandleTypeDef *phost)
Stop the low level portion of the host driver.
Definition: usbh_conf.c:283
default
Definition: createSpeedLookupTable.py:15
Definition: usbh_def.h:320
uint8_t id
Definition: usbh_def.h:462
Definition: stm32f4xx_hal_def.h:58
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:55
Definition: usbh_def.h:330
Definition: usbh_def.h:328
Definition: usbh_def.h:329
USBH_StatusTypeDef USBH_FreePipe(USBH_HandleTypeDef *phost, uint8_t idx)
USBH_Free_Pipe Free the USB Pipe.
Definition: usbh_pipes.c:158
Definition: usbh_def.h:340
USBH_CfgDescTypeDef CfgDesc
Definition: usbh_def.h:430
Definition: usbh_def.h:321
uint8_t bNumConfigurations
Definition: usbh_def.h:255
USBH_StatusTypeDef USBH_OpenPipe(USBH_HandleTypeDef *phost, uint8_t ch_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps)
USBH_Open_Pipe Open a pipe.
Definition: usbh_pipes.c:93
void USBH_LL_SetTimer(USBH_HandleTypeDef *phost, uint32_t)
USBH_LL_SetTimer Set the initial Host Timer tick.
Definition: usbh_core.c:791
USBH_StatusTypeDef USBH_LL_Start(USBH_HandleTypeDef *phost)
Start the low level portion of the host driver.
Definition: usbh_conf.c:252
#define USBH_PROCESS_STACK_SIZE
Definition: usbh_conf.h:133
#define TRUE
Definition: usbh_def.h:61
uint8_t ClassCode
Definition: usbh_def.h:440
#define USBH_MAX_NUM_SUPPORTED_CLASS
Definition: usbh_conf.h:111
Definition: usbh_def.h:304
#define configMINIMAL_STACK_SIZE
Definition: FreeRTOSConfig.h:111
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:399
Definition: usbh_def.h:286
USBH_StatusTypeDef USBH_Stop(USBH_HandleTypeDef *phost)
USBH_Stop Stop the USB Host Core.
Definition: usbh_core.c:350
USBH_DeviceTypeDef device
Definition: usbh_def.h:456
uint8_t speed
Definition: usbh_def.h:426
__IO uint8_t is_connected
Definition: usbh_def.h:427
uint8_t pipe_size
Definition: usbh_def.h:408
USBH_StatusTypeDef(* DeInit)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:442
#define USBH_PROCESS_PRIO
Definition: usbh_conf.h:132
Definition: usbh_def.h:319
USBH_StatusTypeDef(* Init)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:441
uint8_t pipe_in
Definition: usbh_def.h:406
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1057
#define HOST_USER_CLASS_SELECTED
Definition: usbh_core.h:66
#define FALSE
Definition: usbh_def.h:57
const uint8_t[]
Definition: 404_html.c:3
#define USBH_UsrLog(...)
Definition: usbh_conf.h:166
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
Initialize the low level portion of the host driver.
Definition: usbh_conf.c:191
USBH_StatusTypeDef
Definition: usbh_def.h:302
uint8_t bInterfaceProtocol
Definition: usbh_def.h:279
uint8_t bInterfaceSubClass
Definition: usbh_def.h:278
static USBH_StatusTypeDef DeInitStateMachine(USBH_HandleTypeDef *phost)
DeInitStateMachine De-Initialize the Host state machine.
Definition: usbh_core.c:162
USBH_ClassTypeDef * pClass[USBH_MAX_NUM_SUPPORTED_CLASS]
Definition: usbh_def.h:457
static status_t status
Definition: filament_sensor.c:37
uint32_t ClassNumber
Definition: usbh_def.h:459
uint8_t pipe_out
Definition: usbh_def.h:407
void * pData
Definition: usbh_def.h:463
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
Definition: cmsis_os.c:1086
USBH_SpeedTypeDef
Definition: usbh_def.h:317
#define osMessageQ(name)
Access a Message Queue Definition.
Definition: cmsis_os.h:829
Definition: usbh_def.h:306
Definition: usbh_def.h:305
void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
Definition: stm32f4xx_hal.c:393
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
Definition: usbh_def.h:464
const char * Name
Definition: usbh_def.h:439
#define USBH_MAX_NUM_INTERFACES
Definition: usbh_conf.h:102
png_uint_32 length
Definition: png.c:2247
USBH_ClassTypeDef * pActiveClass
Definition: usbh_def.h:458
static void USBH_HandleSof(USBH_HandleTypeDef *phost)
USBH_HandleSof Call SOF process.
Definition: usbh_core.c:813
__IO HOST_StateTypeDef gState
Definition: usbh_def.h:452
#define USBH_EP_CONTROL
Definition: usbh_ioreq.h:61
Definition: usbh_def.h:395
uint8_t USBH_AllocPipe(USBH_HandleTypeDef *phost, uint8_t ep_addr)
USBH_Alloc_Pipe Allocate a new Pipe.
Definition: usbh_pipes.c:138
uint8_t bAlternateSetting
Definition: usbh_def.h:275
Definition: usbh_def.h:338
osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument)
Create a thread and add it to Active Threads and set it to state READY.
Definition: cmsis_os.c:245
Definition: usbh_def.h:336
#define osThread(name)
Definition: cmsis_os.h:478
uint8_t bInterfaceClass
Definition: usbh_def.h:277
#define osMessageQDef(name, queue_sz, type)
Create a Message Queue Definition.
Definition: cmsis_os.h:818