Prusa MINI Firmware overview
cpu_utils.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file cpu_utils.h
4  * @author MCD Application Team
5  * @version V1.1.0
6  * @date 20-November-2014
7  * @brief Header for cpu_utils module
8  ******************************************************************************
9  * @attention
10  *
11  * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
12  *
13  * Redistribution and use in source and binary forms, with or without modification,
14  * are permitted provided that the following conditions are met:
15  * 1. Redistributions of source code must retain the above copyright notice,
16  * this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  * 3. Neither the name of STMicroelectronics nor the names of its contributors
21  * may be used to endorse or promote products derived from this software
22  * without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  ******************************************************************************
36  */
37 
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef _CPU_UTILS_H__
40 #define _CPU_UTILS_H__
41 
42 #ifdef __cplusplus
43  extern "C" {
44 #endif
45 
46 /* Includes ------------------------------------------------------------------*/
47 #include "main.h"
48 
49 /* Exported types ------------------------------------------------------------*/
50 /* Exported constants --------------------------------------------------------*/
51 /* Exported variables --------------------------------------------------------*/
52 /* Exported macro ------------------------------------------------------------*/
53 #define CALCULATION_PERIOD 1000
54 
55 /* Exported functions ------------------------------------------------------- */
56 uint16_t osGetCPUUsage (void);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif /* _CPU_UTILS_H__ */
63 
64 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
CMD_WAIT
Definition: usbh_def.h:381
USBH_URB_ERROR
Definition: usbh_def.h:389
USB_REQ_SET_ADDRESS
#define USB_REQ_SET_ADDRESS
Definition: usbd_def.h:86
osCPU_TotalIdleTime
uint32_t osCPU_TotalIdleTime
Definition: cpu_utils.c:67
_DeviceDescriptor::idVendor
uint16_t idVendor
Definition: usbh_def.h:249
USB_DESC_TYPE_STRING
#define USB_DESC_TYPE_STRING
Definition: usbd_def.h:97
USBH_CtrlTypeDef::setup
USB_Setup_TypeDef setup
Definition: usbh_def.h:412
USB_REQ_SET_CONFIGURATION
#define USB_REQ_SET_CONFIGURATION
Definition: usbd_def.h:90
xIdleHandle
xTaskHandle xIdleHandle
Definition: cpu_utils.c:63
direction
uint8_t direction
Definition: UsbCore.h:185
USBH_SetAddress
USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, uint8_t DeviceAddress)
USBH_SetAddress This command sets the address to the connected device.
Definition: usbh_ctlreq.c:236
HOST_CHECK_CLASS
Definition: usbh_def.h:337
CTRL_DATA_IN
Definition: usbh_def.h:362
osGetCPUUsage
uint16_t osGetCPUUsage(void)
Stop Idle monitor.
Definition: cpu_utils.c:139
USBH_CtrlTypeDef::buff
uint8_t * buff
Definition: usbh_def.h:409
CTRL_STALLED
Definition: usbh_def.h:371
USBH_LL_GetSpeed
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost)
Return the USB host speed from the low level driver.
Definition: usbh_conf.c:314
_DeviceDescriptor::bDeviceClass
uint8_t bDeviceClass
Definition: usbh_def.h:242
CTRL_STATUS_IN_WAIT
Definition: usbh_def.h:367
HOST_USER_SELECT_CONFIGURATION
#define HOST_USER_SELECT_CONFIGURATION
Definition: usbh_core.h:64
task.h
_ConfigurationDescriptor::bLength
uint8_t bLength
Definition: usbh_def.h:288
USBH_SetCfg
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
_InterfaceDescriptor::bNumEndpoints
uint8_t bNumEndpoints
Definition: usbh_def.h:276
USB_DESC_TYPE_ENDPOINT
#define USB_DESC_TYPE_ENDPOINT
Definition: usbd_def.h:99
USBH_ClrFeature
USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, uint8_t ep_num)
USBH_ClrFeature This request is used to clear or disable a specific feature.
Definition: usbh_ctlreq.c:308
ENUM_SET_ADDR
Definition: usbh_def.h:348
USBH_LL_SubmitURB
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.
Definition: usbh_conf.c:475
CTRL_DATA_OUT_WAIT
Definition: usbh_def.h:365
vApplicationIdleHook
void vApplicationIdleHook(void)
Application Idle Hook.
Definition: cpu_utils.c:75
osGetCPUUsage
uint16_t osGetCPUUsage(void)
Stop Idle monitor.
Definition: cpu_utils.c:139
osThreadDef
#define osThreadDef(name, thread, priority, instances, stacksz)
Definition: cmsis_os.h:468
usbh_core.h
Header file for usbh_core.c.
USBH_DeviceTypeDef::current_interface
uint8_t current_interface
Definition: usbh_def.h:428
USBH_RegisterClass
USBH_StatusTypeDef USBH_RegisterClass(USBH_HandleTypeDef *phost, USBH_ClassTypeDef *pclass)
USBH_RegisterClass Link class driver to Host Core.
Definition: usbh_core.c:199
USBH_AllocPipe
uint8_t USBH_AllocPipe(USBH_HandleTypeDef *phost, uint8_t ep_addr)
USBH_Alloc_Pipe Allocate a new Pipe.
Definition: usbh_pipes.c:138
USBH_Get_CfgDesc
USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, uint16_t length)
USBH_Get_CfgDesc Issues Configuration Descriptor to the device. Once the response received,...
Definition: usbh_ctlreq.c:137
USBH_URB_NOTREADY
Definition: usbh_def.h:387
_ConfigurationDescriptor::Itf_Desc
USBH_InterfaceDescTypeDef Itf_Desc[USBH_MAX_NUM_INTERFACES]
Definition: usbh_def.h:296
USBH_Get_CfgDesc
USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, uint16_t length)
USBH_Get_CfgDesc Issues Configuration Descriptor to the device. Once the response received,...
Definition: usbh_ctlreq.c:137
_USB_Setup::_SetupPkt_Struc::bRequest
uint8_t bRequest
Definition: usbh_def.h:222
USBH_HandleEnum
static USBH_StatusTypeDef USBH_HandleEnum(USBH_HandleTypeDef *phost)
USBH_HandleEnum This function includes the complete enumeration process.
Definition: usbh_core.c:609
USBH_Start
USBH_StatusTypeDef USBH_Start(USBH_HandleTypeDef *phost)
USBH_Start Start the USB Host Core.
Definition: usbh_core.c:333
HOST_USER_DISCONNECTION
#define HOST_USER_DISCONNECTION
Definition: usbh_core.h:68
USBH_HandleControl
static USBH_StatusTypeDef USBH_HandleControl(USBH_HandleTypeDef *phost)
USBH_HandleControl Handles the USB control transfer state machine.
Definition: usbh_ctlreq.c:581
USBH_CtlSendData
USBH_StatusTypeDef USBH_CtlSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num, uint8_t do_ping)
USBH_CtlSendData Sends a data Packet to the Device.
Definition: usbh_ioreq.c:126
USBH_ReEnumerate
USBH_StatusTypeDef USBH_ReEnumerate(USBH_HandleTypeDef *phost)
HCD_ReEnumerate Perform a new Enumeration phase.
Definition: usbh_core.c:371
USBH_CtlSendSetup
USBH_StatusTypeDef USBH_CtlSendSetup(USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t pipe_num)
USBH_CtlSendSetup Sends the Setup Packet to the Device.
Definition: usbh_ioreq.c:100
_InterfaceDescriptor::Ep_Desc
USBH_EpDescTypeDef Ep_Desc[USBH_MAX_NUM_ENDPOINTS]
Definition: usbh_def.h:281
USBH_PID_DATA
#define USBH_PID_DATA
Definition: usbh_ioreq.h:59
USBH_Delay
void USBH_Delay(uint32_t Delay)
Delay routine for the USB Host Library.
Definition: usbh_conf.c:601
_USBH_HandleTypeDef::RequestState
CMD_StateTypeDef RequestState
Definition: usbh_def.h:454
HOST_INPUT
Definition: usbh_def.h:335
USBH_DeviceTypeDef::Data
uint8_t Data[USBH_MAX_DATA_BUFFER]
Definition: usbh_def.h:424
USB_REQ_CLEAR_FEATURE
#define USB_REQ_CLEAR_FEATURE
Definition: usbd_def.h:84
usbh_pipes.h
Header file for usbh_pipes.c.
USBH_SetAddress
USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, uint8_t DeviceAddress)
USBH_SetAddress This command sets the address to the connected device.
Definition: usbh_ctlreq.c:236
USBH_DeviceTypeDef::DevDesc
USBH_DevDescTypeDef DevDesc
Definition: usbh_def.h:429
_InterfaceDescriptor::bInterfaceNumber
uint8_t bInterfaceNumber
Definition: usbh_def.h:274
USBH_Get_DevDesc
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,...
Definition: usbh_ctlreq.c:112
USBH_ErrLog
#define USBH_ErrLog(...)
Definition: usbh_conf.h:176
USBH_Get_StringDesc
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,...
Definition: usbh_ctlreq.c:175
USBH_ClassTypeDef::Requests
USBH_StatusTypeDef(* Requests)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:443
xTaskGetTickCountFromISR
PRIVILEGED_FUNCTION TickType_t xTaskGetTickCountFromISR(void)
Definition: tasks.c:2142
USBH_LL_DriverVBUS
USBH_StatusTypeDef USBH_LL_DriverVBUS(USBH_HandleTypeDef *phost, uint8_t)
Drive VBUS.
Definition: usbh_conf.c:532
USBH_GetActiveClass
uint8_t USBH_GetActiveClass(USBH_HandleTypeDef *phost)
USBH_GetActiveClass Return Device Class.
Definition: usbh_core.c:260
i
uint8_t i
Definition: screen_test_graph.c:72
usbh_ioreq.h
Header file for usbh_ioreq.c.
ENUM_GET_FULL_CFG_DESC
Definition: usbh_def.h:350
_USB_Setup::_SetupPkt_Struc::wIndex
uint16_t_uint8_t wIndex
Definition: usbh_def.h:224
USBH_ClassTypeDef::BgndProcess
USBH_StatusTypeDef(* BgndProcess)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:444
USBH_URB_DONE
Definition: usbh_def.h:386
USBH_CtrlTypeDef::length
uint16_t length
Definition: usbh_def.h:410
_ConfigurationDescriptor::bConfigurationValue
uint8_t bConfigurationValue
Definition: usbh_def.h:292
USBH_ParseDevDesc
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
HOST_DEV_DISCONNECTED
Definition: usbh_def.h:331
HOST_CLASS_REQUEST
Definition: usbh_def.h:334
USBH_CtlSendData
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
_DeviceDescriptor::bcdDevice
uint16_t bcdDevice
Definition: usbh_def.h:251
USB_CONFIGURATION_DESC_SIZE
#define USB_CONFIGURATION_DESC_SIZE
Definition: usbh_def.h:151
cpu_utils.h
Header for cpu_utils module.
USBH_LL_OpenPipe
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.
Definition: usbh_conf.c:388
_DeviceDescriptor::bcdUSB
uint16_t bcdUSB
Definition: usbh_def.h:241
USBH_ParseEPDesc
static void USBH_ParseEPDesc(USBH_EpDescTypeDef *ep_descriptor, uint8_t *buf)
USBH_ParseEPDesc This function Parses the endpoint descriptor.
Definition: usbh_ctlreq.c:452
_DeviceDescriptor::bDeviceProtocol
uint8_t bDeviceProtocol
Definition: usbh_def.h:244
_USBH_HandleTypeDef::Timer
__IO uint32_t Timer
Definition: usbh_def.h:461
HOST_USER_CONNECTION
#define HOST_USER_CONNECTION
Definition: usbh_core.h:67
CTRL_DATA_IN_WAIT
Definition: usbh_def.h:363
_DeviceDescriptor::iManufacturer
uint8_t iManufacturer
Definition: usbh_def.h:252
_USBH_HandleTypeDef
Definition: usbh_def.h:450
HOST_ENUMERATION
Definition: usbh_def.h:333
USB_REQ_SET_INTERFACE
#define USB_REQ_SET_INTERFACE
Definition: usbd_def.h:92
NULL
#define NULL
Definition: usbd_def.h:53
_DescHeader
Definition: usbh_def.h:230
USBH_ClassTypeDef::pData
void * pData
Definition: usbh_def.h:446
osEvent::status
osStatus status
status code: event or error information
Definition: cmsis_os.h:396
USBH_GetFreePipe
static uint16_t USBH_GetFreePipe(USBH_HandleTypeDef *phost)
USBH_GetFreePipe.
Definition: usbh_pipes.c:173
_USBH_HandleTypeDef::Control
USBH_CtrlTypeDef Control
Definition: usbh_def.h:455
USBH_URB_IDLE
Definition: usbh_def.h:385
_USB_Setup::_SetupPkt_Struc::wValue
uint16_t_uint8_t wValue
Definition: usbh_def.h:223
USBH_LL_ResetPort
USBH_StatusTypeDef USBH_LL_ResetPort(USBH_HandleTypeDef *phost)
Reset the Host port of the low level driver.
Definition: usbh_conf.c:342
USBH_LL_SetTimer
void USBH_LL_SetTimer(USBH_HandleTypeDef *phost, uint32_t time)
USBH_LL_SetTimer Set the initial Host Timer tick.
Definition: usbh_core.c:791
_InterfaceDescriptor
Definition: usbh_def.h:270
osMessageGet
osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec)
Get a Message or Wait for a Message from a Queue.
Definition: cmsis_os.c:1145
USBH_DeviceTypeDef::address
uint8_t address
Definition: usbh_def.h:425
USBH_LL_Stop
USBH_StatusTypeDef USBH_LL_Stop(USBH_HandleTypeDef *phost)
Stop the low level portion of the host driver.
Definition: usbh_conf.c:283
createSpeedLookupTable.default
default
Definition: createSpeedLookupTable.py:15
USBH_SPEED_FULL
Definition: usbh_def.h:320
USB_DESC_STRING
#define USB_DESC_STRING
Definition: usbh_def.h:160
USB_REQ_RECIPIENT_DEVICE
#define USB_REQ_RECIPIENT_DEVICE
Definition: usbd_def.h:78
_USBH_HandleTypeDef::id
uint8_t id
Definition: usbh_def.h:462
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usbd_def.h:79
USBH_CtlReceiveData
USBH_StatusTypeDef USBH_CtlReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num)
USBH_CtlReceiveData Receives the Device Response to the Setup Packet.
Definition: usbh_ioreq.c:159
HOST_DEV_ATTACHED
Definition: usbh_def.h:330
HOST_IDLE
Definition: usbh_def.h:328
USBH_CtlReceiveData
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
HOST_DEV_WAIT_FOR_ATTACHMENT
Definition: usbh_def.h:329
USBH_FreePipe
USBH_StatusTypeDef USBH_FreePipe(USBH_HandleTypeDef *phost, uint8_t idx)
USBH_Free_Pipe Free the USB Pipe.
Definition: usbh_pipes.c:158
CTRL_DATA_OUT
Definition: usbh_def.h:364
USB_REQ_GET_DESCRIPTOR
#define USB_REQ_GET_DESCRIPTOR
Definition: usbd_def.h:87
_EndpointDescriptor
Definition: usbh_def.h:259
HOST_ABORT_STATE
Definition: usbh_def.h:340
USBH_Init
USBH_StatusTypeDef USBH_Init(USBH_HandleTypeDef *phost, void(*pUsrFunc)(USBH_HandleTypeDef *phost, uint8_t), uint8_t id)
HCD_Init Initialize the HOST Core.
Definition: usbh_core.c:92
osEvent
Definition: cmsis_os.h:395
USBH_ClassTypeDef::SOFProcess
USBH_StatusTypeDef(* SOFProcess)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:445
USBH_DeviceTypeDef::CfgDesc
USBH_CfgDescTypeDef CfgDesc
Definition: usbh_def.h:430
FEATURE_SELECTOR_ENDPOINT
#define FEATURE_SELECTOR_ENDPOINT
Definition: usbh_ctlreq.h:57
USBH_ADDRESS_DEFAULT
#define USBH_ADDRESS_DEFAULT
Definition: usbh_core.c:51
_DeviceDescriptor::bNumConfigurations
uint8_t bNumConfigurations
Definition: usbh_def.h:255
_ConfigurationDescriptor::bDescriptorType
uint8_t bDescriptorType
Definition: usbh_def.h:289
USBH_OpenPipe
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
USBH_LL_Start
USBH_StatusTypeDef USBH_LL_Start(USBH_HandleTypeDef *phost)
Start the low level portion of the host driver.
Definition: usbh_conf.c:252
ENUM_IDLE
Definition: usbh_def.h:346
CMD_SEND
Definition: usbh_def.h:380
USBH_PID_SETUP
#define USBH_PID_SETUP
Definition: usbh_ioreq.h:58
_USB_Setup::_SetupPkt_Struc::wLength
uint16_t_uint8_t wLength
Definition: usbh_def.h:225
USBH_PROCESS_STACK_SIZE
#define USBH_PROCESS_STACK_SIZE
Definition: usbh_conf.h:133
USBH_URB_EVENT
Definition: usbh_def.h:396
USBH_Get_DevDesc
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,...
Definition: usbh_ctlreq.c:112
USBH_FindInterface
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.
Definition: usbh_core.c:274
osCPU_IdleStartTime
uint32_t osCPU_IdleStartTime
Definition: cpu_utils.c:65
xTaskHandle
#define xTaskHandle
Definition: FreeRTOS.h:826
USBH_SETUP_PKT_SIZE
#define USBH_SETUP_PKT_SIZE
Definition: usbh_ioreq.h:66
ENUM_GET_MFC_STRING_DESC
Definition: usbh_def.h:351
TRUE
#define TRUE
Definition: usbh_def.h:61
ENUM_GET_SERIALNUM_STRING_DESC
Definition: usbh_def.h:353
USBH_ClassTypeDef::ClassCode
uint8_t ClassCode
Definition: usbh_def.h:440
CTRL_COMPLETE
Definition: usbh_def.h:372
USBH_MPS_DEFAULT
#define USBH_MPS_DEFAULT
Definition: usbh_core.c:53
xTaskGetCurrentTaskHandle
PRIVILEGED_FUNCTION TaskHandle_t xTaskGetCurrentTaskHandle(void)
USBH_MAX_NUM_SUPPORTED_CLASS
#define USBH_MAX_NUM_SUPPORTED_CLASS
Definition: usbh_conf.h:111
USBH_OK
Definition: usbh_def.h:304
USBH_SetCfg
USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t cfg_idx)
USBH_SetCfg The command sets the configuration value to the connected device.
Definition: usbh_ctlreq.c:260
configMINIMAL_STACK_SIZE
#define configMINIMAL_STACK_SIZE
Definition: FreeRTOSConfig.h:111
osMessagePut
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
Definition: cmsis_os.c:1113
USBH_STATE_CHANGED_EVENT
Definition: usbh_def.h:399
USBH_DeInit
USBH_StatusTypeDef USBH_DeInit(USBH_HandleTypeDef *phost)
HCD_Init De-Initialize the Host portion of the driver.
Definition: usbh_core.c:143
USBH_Get_StringDesc
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,...
Definition: usbh_ctlreq.c:175
CTRL_STATUS_OUT
Definition: usbh_def.h:368
_ConfigurationDescriptor
Definition: usbh_def.h:286
USBH_Process
USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
USBH_Process Background process of the USB Core.
Definition: usbh_core.c:397
osEventMessage
function completed; message event occurred.
Definition: cmsis_os.h:237
USBH_Stop
USBH_StatusTypeDef USBH_Stop(USBH_HandleTypeDef *phost)
USBH_Stop Stop the USB Host Core.
Definition: usbh_core.c:350
ENUM_GET_FULL_DEV_DESC
Definition: usbh_def.h:347
_USBH_HandleTypeDef::device
USBH_DeviceTypeDef device
Definition: usbh_def.h:456
osCPU_IdleSpentTime
uint32_t osCPU_IdleSpentTime
Definition: cpu_utils.c:66
USBH_DeviceTypeDef::speed
uint8_t speed
Definition: usbh_def.h:426
USBH_DEVICE_ADDRESS
#define USBH_DEVICE_ADDRESS
Definition: usbh_def.h:185
CTRL_SETUP_WAIT
Definition: usbh_def.h:361
USBH_CONTROL_EVENT
Definition: usbh_def.h:397
USBH_DeviceTypeDef::is_connected
__IO uint8_t is_connected
Definition: usbh_def.h:427
USBH_CtrlTypeDef::state
CTRL_StateTypeDef state
Definition: usbh_def.h:413
USBH_CtrlTypeDef::pipe_size
uint8_t pipe_size
Definition: usbh_def.h:408
_USBH_HandleTypeDef::Pipes
uint32_t Pipes[15]
Definition: usbh_def.h:460
USBH_EP_ISO
#define USBH_EP_ISO
Definition: usbh_ioreq.h:62
ENUM_GET_PRODUCT_STRING_DESC
Definition: usbh_def.h:352
USBH_LL_Disconnect
USBH_StatusTypeDef USBH_LL_Disconnect(USBH_HandleTypeDef *phost)
USBH_LL_Disconnect Handle USB Host disconnection event.
Definition: usbh_core.c:854
USBH_ClassTypeDef::DeInit
USBH_StatusTypeDef(* DeInit)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:442
_EndpointDescriptor::bmAttributes
uint8_t bmAttributes
Definition: usbh_def.h:264
USBH_PROCESS_PRIO
#define USBH_PROCESS_PRIO
Definition: usbh_conf.h:132
USBH_EP_INTERRUPT
#define USBH_EP_INTERRUPT
Definition: usbh_ioreq.h:64
_DeviceDescriptor::iProduct
uint8_t iProduct
Definition: usbh_def.h:253
osWaitForever
#define osWaitForever
wait forever timeout value
Definition: cmsis_os.h:230
USBH_SPEED_HIGH
Definition: usbh_def.h:319
USBH_ClassTypeDef::Init
USBH_StatusTypeDef(* Init)(struct _USBH_HandleTypeDef *phost)
Definition: usbh_def.h:441
_DeviceDescriptor
Definition: usbh_def.h:237
_DeviceDescriptor::bMaxPacketSize
uint8_t bMaxPacketSize
Definition: usbh_def.h:248
USBH_URB_STALL
Definition: usbh_def.h:390
_ConfigurationDescriptor::bNumInterfaces
uint8_t bNumInterfaces
Definition: usbh_def.h:291
USBH_BulkReceiveData
USBH_StatusTypeDef USBH_BulkReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num)
USBH_BulkReceiveData Receives IN bulk packet from device.
Definition: usbh_ioreq.c:218
_DeviceDescriptor::bLength
uint8_t bLength
Definition: usbh_def.h:239
USBH_LL_GetURBState
USBH_URBStateTypeDef USBH_LL_GetURBState(USBH_HandleTypeDef *phost, uint8_t)
Get a URB state from the low level driver.
Definition: usbh_conf.c:519
USBH_CtrlTypeDef::pipe_in
uint8_t pipe_in
Definition: usbh_def.h:406
_ConfigurationDescriptor::iConfiguration
uint8_t iConfiguration
Definition: usbh_def.h:293
USBH_SetInterface
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.
Definition: usbh_ctlreq.c:283
USBH_ParseStringDesc
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
HOST_USER_CLASS_SELECTED
#define HOST_USER_CLASS_SELECTED
Definition: usbh_core.h:66
FALSE
#define FALSE
Definition: usbh_def.h:57
FreeRTOS.h
uint8_t
const uint8_t[]
Definition: 404_html.c:3
CTRL_STATUS_IN
Definition: usbh_def.h:366
USBH_IsocReceiveData
USBH_StatusTypeDef USBH_IsocReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint32_t length, uint8_t pipe_num)
USBH_IsocReceiveData Receives the Device Response to the Isochronous IN token.
Definition: usbh_ioreq.c:296
USBH_ParseCfgDesc
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_CtlReq
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
USBH_UsrLog
#define USBH_UsrLog(...)
Definition: usbh_conf.h:166
USBH_OpenPipe
USBH_StatusTypeDef USBH_OpenPipe(USBH_HandleTypeDef *phost, uint8_t pipe_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
USBH_SelectInterface
USBH_StatusTypeDef USBH_SelectInterface(USBH_HandleTypeDef *phost, uint8_t interface)
USBH_SelectInterface Select current interface.
Definition: usbh_core.c:233
USBH_LL_Init
USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost)
Initialize the low level portion of the host driver.
Definition: usbh_conf.c:191
_EndpointDescriptor::bDescriptorType
uint8_t bDescriptorType
Definition: usbh_def.h:262
_USB_Setup::b
struct _USB_Setup::_SetupPkt_Struc b
USBH_InterruptSendData
USBH_StatusTypeDef USBH_InterruptSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t length, uint8_t pipe_num)
USBH_InterruptSendData Sends the data on Interrupt OUT Endpoint.
Definition: usbh_ioreq.c:270
USBH_StatusTypeDef
USBH_StatusTypeDef
Definition: usbh_def.h:302
USBH_LL_Connect
USBH_StatusTypeDef USBH_LL_Connect(USBH_HandleTypeDef *phost)
USBH_LL_Connect Handle USB Host connexion event.
Definition: usbh_core.c:826
_DeviceDescriptor::idProduct
uint16_t idProduct
Definition: usbh_def.h:250
CTRL_SETUP
Definition: usbh_def.h:360
_USBH_HandleTypeDef::EnumState
ENUM_StateTypeDef EnumState
Definition: usbh_def.h:453
_ConfigurationDescriptor::bMaxPower
uint8_t bMaxPower
Definition: usbh_def.h:295
USBH_IsocSendData
USBH_StatusTypeDef USBH_IsocSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint32_t length, uint8_t pipe_num)
USBH_IsocSendData Sends the data on Isochronous OUT Endpoint.
Definition: usbh_ioreq.c:323
USBH_FindInterfaceIndex
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...
Definition: usbh_core.c:306
_InterfaceDescriptor::bInterfaceProtocol
uint8_t bInterfaceProtocol
Definition: usbh_def.h:279
osCPU_Usage
__IO uint32_t osCPU_Usage
Definition: cpu_utils.c:64
_InterfaceDescriptor::bInterfaceSubClass
uint8_t bInterfaceSubClass
Definition: usbh_def.h:278
DeInitStateMachine
static USBH_StatusTypeDef DeInitStateMachine(USBH_HandleTypeDef *phost)
DeInitStateMachine De-Initialize the Host state machine.
Definition: usbh_core.c:162
USBH_EP_BULK
#define USBH_EP_BULK
Definition: usbh_ioreq.h:63
main.h
: Header for main.c file. This file contains the common defines of the application.
_DeviceDescriptor::bDeviceSubClass
uint8_t bDeviceSubClass
Definition: usbh_def.h:243
_USBH_HandleTypeDef::pClass
USBH_ClassTypeDef * pClass[USBH_MAX_NUM_SUPPORTED_CLASS]
Definition: usbh_def.h:457
EndIdleMonitor
void EndIdleMonitor(void)
Stop Idle monitor.
Definition: cpu_utils.c:124
USBH_CtrlTypeDef::timer
uint16_t timer
Definition: usbh_def.h:411
USBH_CtrlTypeDef::errorcount
uint8_t errorcount
Definition: usbh_def.h:414
_DescHeader::bLength
uint8_t bLength
Definition: usbh_def.h:232
status
static status_t status
Definition: filament_sensor.c:37
USB_H2D
#define USB_H2D
Definition: usbh_def.h:108
USBH_CtlSendSetup
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
_USBH_HandleTypeDef::ClassNumber
uint32_t ClassNumber
Definition: usbh_def.h:459
USBH_CtrlTypeDef::pipe_out
uint8_t pipe_out
Definition: usbh_def.h:407
_InterfaceDescriptor::iInterface
uint8_t iInterface
Definition: usbh_def.h:280
_USBH_HandleTypeDef::pData
void * pData
Definition: usbh_def.h:463
CALCULATION_PERIOD
#define CALCULATION_PERIOD
Definition: cpu_utils.h:53
vApplicationTickHook
void vApplicationTickHook(void)
Application Idle Hook.
Definition: cpu_utils.c:89
osMessageCreate
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
Definition: cmsis_os.c:1086
CTRL_IDLE
Definition: usbh_def.h:359
uint16_t_uint8_t::w
uint16_t w
Definition: usbh_def.h:204
_DeviceDescriptor::iSerialNumber
uint8_t iSerialNumber
Definition: usbh_def.h:254
usbh_ctlreq.h
Header file for usbh_ctlreq.c.
USBH_MAX_DATA_BUFFER
#define USBH_MAX_DATA_BUFFER
Definition: usbh_conf.h:117
osMessageQ
#define osMessageQ(name)
Access a Message Queue Definition.
Definition: cmsis_os.h:829
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usbd_def.h:80
USBH_GetNextDesc
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_GetDescriptor
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
USB_DESC_TYPE_INTERFACE
#define USB_DESC_TYPE_INTERFACE
Definition: usbd_def.h:98
USBH_FAIL
Definition: usbh_def.h:306
USB_D2H
#define USB_D2H
Definition: usbh_def.h:109
USBH_BUSY
Definition: usbh_def.h:305
USB_DESC_CONFIGURATION
#define USB_DESC_CONFIGURATION
Definition: usbh_def.h:159
_ConfigurationDescriptor::wTotalLength
uint16_t wTotalLength
Definition: usbh_def.h:290
USB_DESC_DEVICE
#define USB_DESC_DEVICE
Definition: usbh_def.h:158
USBH_MAX_ERROR_COUNT
#define USBH_MAX_ERROR_COUNT
Definition: usbh_def.h:184
_EndpointDescriptor::bInterval
uint8_t bInterval
Definition: usbh_def.h:266
_USBH_HandleTypeDef::pUser
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
Definition: usbh_def.h:464
USBH_LL_ClosePipe
USBH_StatusTypeDef USBH_LL_ClosePipe(USBH_HandleTypeDef *phost, uint8_t)
Close a pipe of the low level driver.
Definition: usbh_conf.c:422
USBH_ClassTypeDef::Name
const char * Name
Definition: usbh_def.h:439
USBH_MAX_NUM_INTERFACES
#define USBH_MAX_NUM_INTERFACES
Definition: usbh_conf.h:102
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
Definition: usbd_def.h:73
length
png_uint_32 length
Definition: png.c:2247
_InterfaceDescriptor::bDescriptorType
uint8_t bDescriptorType
Definition: usbh_def.h:273
USBH_URBStateTypeDef
USBH_URBStateTypeDef
Definition: usbh_def.h:384
_USB_Setup::_SetupPkt_Struc::bmRequestType
uint8_t bmRequestType
Definition: usbh_def.h:221
USBH_InterruptReceiveData
USBH_StatusTypeDef USBH_InterruptReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint8_t length, uint8_t pipe_num)
USBH_InterruptReceiveData Receives the Device Response to the Interrupt IN token.
Definition: usbh_ioreq.c:244
_EndpointDescriptor::bLength
uint8_t bLength
Definition: usbh_def.h:261
_USBH_HandleTypeDef::pActiveClass
USBH_ClassTypeDef * pActiveClass
Definition: usbh_def.h:458
USBH_ParseInterfaceDesc
static void USBH_ParseInterfaceDesc(USBH_InterfaceDescTypeDef *if_descriptor, uint8_t *buf)
USBH_ParseInterfaceDesc This function Parses the interface descriptor.
Definition: usbh_ctlreq.c:431
_ConfigurationDescriptor::bmAttributes
uint8_t bmAttributes
Definition: usbh_def.h:294
USBH_HandleSof
static void USBH_HandleSof(USBH_HandleTypeDef *phost)
USBH_HandleSof Call SOF process.
Definition: usbh_core.c:813
_USBH_HandleTypeDef::gState
__IO HOST_StateTypeDef gState
Definition: usbh_def.h:452
LE16
#define LE16(addr)
Definition: usbh_def.h:69
USBH_BulkSendData
USBH_StatusTypeDef USBH_BulkSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num, uint8_t do_ping)
USBH_BulkSendData Sends the Bulk Packet to the device.
Definition: usbh_ioreq.c:186
USBH_EP_CONTROL
#define USBH_EP_CONTROL
Definition: usbh_ioreq.h:61
USBH_PORT_EVENT
Definition: usbh_def.h:395
USB_DEVICE_DESC_SIZE
#define USB_DEVICE_DESC_SIZE
Definition: usbh_def.h:150
pbuf
Definition: pbuf.h:142
USBH_AllocPipe
uint8_t USBH_AllocPipe(USBH_HandleTypeDef *phost, uint8_t ep_addr)
USBH_Alloc_Pipe Allocate a new Pipe.
Definition: usbh_pipes.c:138
HOST_USER_UNRECOVERED_ERROR
#define HOST_USER_UNRECOVERED_ERROR
Definition: usbh_core.h:69
_DeviceDescriptor::bDescriptorType
uint8_t bDescriptorType
Definition: usbh_def.h:240
_InterfaceDescriptor::bAlternateSetting
uint8_t bAlternateSetting
Definition: usbh_def.h:275
HOST_CLASS
Definition: usbh_def.h:338
StartIdleMonitor
void StartIdleMonitor(void)
Start Idle monitor.
Definition: cpu_utils.c:111
_EndpointDescriptor::wMaxPacketSize
uint16_t wMaxPacketSize
Definition: usbh_def.h:265
USB_REQ_DIR_MASK
#define USB_REQ_DIR_MASK
Definition: usbh_def.h:107
ENUM_GET_CFG_DESC
Definition: usbh_def.h:349
osThreadCreate
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
_EndpointDescriptor::bEndpointAddress
uint8_t bEndpointAddress
Definition: usbh_def.h:263
HOST_SET_CONFIGURATION
Definition: usbh_def.h:336
USBH_NOT_SUPPORTED
Definition: usbh_def.h:307
USBH_ClosePipe
USBH_StatusTypeDef USBH_ClosePipe(USBH_HandleTypeDef *phost, uint8_t pipe_num)
USBH_ClosePipe Close a pipe.
Definition: usbh_pipes.c:121
USB_LEN_CFG_DESC
#define USB_LEN_CFG_DESC
Definition: usbd_def.h:59
USBH_MAX_PIPES_NBR
#define USBH_MAX_PIPES_NBR
Definition: usbh_def.h:180
osThread
#define osThread(name)
Definition: cmsis_os.h:478
_USB_Setup::d8
uint32_t d8[2]
Definition: usbh_def.h:217
_InterfaceDescriptor::bLength
uint8_t bLength
Definition: usbh_def.h:272
_InterfaceDescriptor::bInterfaceClass
uint8_t bInterfaceClass
Definition: usbh_def.h:277
USBH_FreePipe
USBH_StatusTypeDef USBH_FreePipe(USBH_HandleTypeDef *phost, uint8_t idx)
USBH_Free_Pipe Free the USB Pipe.
Definition: usbh_pipes.c:158
CTRL_STATUS_OUT_WAIT
Definition: usbh_def.h:369
osMessageQDef
#define osMessageQDef(name, queue_sz, type)
Create a Message Queue Definition.
Definition: cmsis_os.h:818
USBH_ClassTypeDef
Definition: usbh_def.h:437
CTRL_ERROR
Definition: usbh_def.h:370
USBH_LL_IncTimer
void USBH_LL_IncTimer(USBH_HandleTypeDef *phost)
USBH_LL_IncTimer Increment Host Timer tick.
Definition: usbh_core.c:801