1 /** 2 ****************************************************************************** 3 * @file usbh_ctlreq.h 4 * @author MCD Application Team 5 * @brief Header file for usbh_ctlreq.c 6 ****************************************************************************** 7 * @attention 8 * 9 * <h2><center>© Copyright (c) 2015 STMicroelectronics. 10 * All rights reserved.</center></h2> 11 * 12 * This software component is licensed by ST under Ultimate Liberty license 13 * SLA0044, the "License"; You may not use this file except in compliance with 14 * the License. You may obtain a copy of the License at: 15 * www.st.com/SLA0044 16 * 17 ****************************************************************************** 18 */ 19 20 /* Define to prevent recursive ----------------------------------------------*/ 21 #ifndef __USBH_CTLREQ_H 22 #define __USBH_CTLREQ_H 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 /* Includes ------------------------------------------------------------------*/ 29 #include "usbh_core.h" 30 31 /** @addtogroup USBH_LIB 32 * @{ 33 */ 34 35 /** @addtogroup USBH_LIB_CORE 36 * @{ 37 */ 38 39 /** @defgroup USBH_CTLREQ 40 * @brief This file is the 41 * @{ 42 */ 43 44 45 /** @defgroup USBH_CTLREQ_Exported_Defines 46 * @{ 47 */ 48 /*Standard Feature Selector for clear feature command*/ 49 #define FEATURE_SELECTOR_ENDPOINT 0x00U 50 #define FEATURE_SELECTOR_DEVICE 0x01U 51 #define FEATURE_SELECTOR_REMOTEWAKEUP 0X01U 52 53 54 #define INTERFACE_DESC_TYPE 0x04U 55 #define ENDPOINT_DESC_TYPE 0x05U 56 #define INTERFACE_DESC_SIZE 0x09U 57 58 /** 59 * @} 60 */ 61 62 63 /** @defgroup USBH_CTLREQ_Exported_Types 64 * @{ 65 */ 66 /** 67 * @} 68 */ 69 70 71 /** @defgroup USBH_CTLREQ_Exported_Macros 72 * @{ 73 */ 74 /** 75 * @} 76 */ 77 78 /** @defgroup USBH_CTLREQ_Exported_Variables 79 * @{ 80 */ 81 extern uint8_t USBH_CfgDesc[512]; 82 /** 83 * @} 84 */ 85 86 /** @defgroup USBH_CTLREQ_Exported_FunctionsPrototype 87 * @{ 88 */ 89 USBH_StatusTypeDef USBH_CtlReq(USBH_HandleTypeDef *phost, uint8_t *buff, 90 uint16_t length); 91 92 USBH_StatusTypeDef USBH_GetDescriptor(USBH_HandleTypeDef *phost, 93 uint8_t req_type, uint16_t value_idx, 94 uint8_t *buff, uint16_t length); 95 96 USBH_StatusTypeDef USBH_Get_DevDesc(USBH_HandleTypeDef *phost, uint8_t length); 97 98 USBH_StatusTypeDef USBH_Get_StringDesc(USBH_HandleTypeDef *phost, 99 uint8_t string_index, uint8_t *buff, 100 uint16_t length); 101 102 USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, uint16_t cfg_idx); 103 104 USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, uint16_t length); 105 106 USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, 107 uint8_t DeviceAddress); 108 109 USBH_StatusTypeDef USBH_SetInterface(USBH_HandleTypeDef *phost, uint8_t ep_num, 110 uint8_t altSetting); 111 112 USBH_StatusTypeDef USBH_SetFeature(USBH_HandleTypeDef *phost, uint8_t wValue); 113 114 USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, uint8_t ep_num); 115 116 USBH_DescHeader_t *USBH_GetNextDesc(uint8_t *pbuf, uint16_t *ptr); 117 /** 118 * @} 119 */ 120 121 #ifdef __cplusplus 122 } 123 #endif 124 125 #endif /* __USBH_CTLREQ_H */ 126 127 /** 128 * @} 129 */ 130 131 /** 132 * @} 133 */ 134 135 /** 136 * @} 137 */ 138 139 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 140 141 142