| 1 |
/** |
| 2 |
****************************************************************************** |
| 3 |
* @file usbh_ctlreq.h |
| 4 |
* @author MCD Application Team |
| 5 |
* @version V3.0.0 |
| 6 |
* @date 18-February-2014 |
| 7 |
* @brief Header file for usbh_ctlreq.c |
| 8 |
****************************************************************************** |
| 9 |
* @attention |
| 10 |
* |
| 11 |
* <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> |
| 12 |
* |
| 13 |
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
| 14 |
* You may not use this file except in compliance with the License. |
| 15 |
* You may obtain a copy of the License at: |
| 16 |
* |
| 17 |
* http://www.st.com/software_license_agreement_liberty_v2 |
| 18 |
* |
| 19 |
* Unless required by applicable law or agreed to in writing, software |
| 20 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 21 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 22 |
* See the License for the specific language governing permissions and |
| 23 |
* limitations under the License. |
| 24 |
* |
| 25 |
****************************************************************************** |
| 26 |
*/ |
| 27 |
|
| 28 |
/* Define to prevent recursive ----------------------------------------------*/ |
| 29 |
#ifndef __USBH_CTLREQ_H |
| 30 |
#define __USBH_CTLREQ_H |
| 31 |
|
| 32 |
/* Includes ------------------------------------------------------------------*/ |
| 33 |
#include "usbh_core.h" |
| 34 |
|
| 35 |
/** @addtogroup USBH_LIB |
| 36 |
* @{ |
| 37 |
*/ |
| 38 |
|
| 39 |
/** @addtogroup USBH_LIB_CORE |
| 40 |
* @{ |
| 41 |
*/ |
| 42 |
|
| 43 |
/** @defgroup USBH_CTLREQ |
| 44 |
* @brief This file is the |
| 45 |
* @{ |
| 46 |
*/ |
| 47 |
|
| 48 |
|
| 49 |
/** @defgroup USBH_CTLREQ_Exported_Defines |
| 50 |
* @{ |
| 51 |
*/ |
| 52 |
/*Standard Feature Selector for clear feature command*/ |
| 53 |
#define FEATURE_SELECTOR_ENDPOINT 0X00 |
| 54 |
#define FEATURE_SELECTOR_DEVICE 0X01 |
| 55 |
|
| 56 |
|
| 57 |
#define INTERFACE_DESC_TYPE 0x04 |
| 58 |
#define ENDPOINT_DESC_TYPE 0x05 |
| 59 |
#define INTERFACE_DESC_SIZE 0x09 |
| 60 |
|
| 61 |
/** |
| 62 |
* @} |
| 63 |
*/ |
| 64 |
|
| 65 |
|
| 66 |
/** @defgroup USBH_CTLREQ_Exported_Types |
| 67 |
* @{ |
| 68 |
*/ |
| 69 |
/** |
| 70 |
* @} |
| 71 |
*/ |
| 72 |
|
| 73 |
|
| 74 |
/** @defgroup USBH_CTLREQ_Exported_Macros |
| 75 |
* @{ |
| 76 |
*/ |
| 77 |
/** |
| 78 |
* @} |
| 79 |
*/ |
| 80 |
|
| 81 |
/** @defgroup USBH_CTLREQ_Exported_Variables |
| 82 |
* @{ |
| 83 |
*/ |
| 84 |
extern uint8_t USBH_CfgDesc[512]; |
| 85 |
/** |
| 86 |
* @} |
| 87 |
*/ |
| 88 |
|
| 89 |
/** @defgroup USBH_CTLREQ_Exported_FunctionsPrototype |
| 90 |
* @{ |
| 91 |
*/ |
| 92 |
USBH_StatusTypeDef USBH_CtlReq (USBH_HandleTypeDef *phost, |
| 93 |
uint8_t *buff, |
| 94 |
uint16_t length); |
| 95 |
|
| 96 |
USBH_StatusTypeDef USBH_GetDescriptor(USBH_HandleTypeDef *phost, |
| 97 |
uint8_t req_type, |
| 98 |
uint16_t value_idx, |
| 99 |
uint8_t* buff, |
| 100 |
uint16_t length ); |
| 101 |
|
| 102 |
USBH_StatusTypeDef USBH_Get_DevDesc(USBH_HandleTypeDef *phost, |
| 103 |
uint8_t length); |
| 104 |
|
| 105 |
USBH_StatusTypeDef USBH_Get_StringDesc(USBH_HandleTypeDef *phost, |
| 106 |
uint8_t string_index, |
| 107 |
uint8_t *buff, |
| 108 |
uint16_t length); |
| 109 |
|
| 110 |
USBH_StatusTypeDef USBH_SetCfg(USBH_HandleTypeDef *phost, |
| 111 |
uint16_t configuration_value); |
| 112 |
|
| 113 |
USBH_StatusTypeDef USBH_Get_CfgDesc(USBH_HandleTypeDef *phost, |
| 114 |
uint16_t length); |
| 115 |
|
| 116 |
USBH_StatusTypeDef USBH_SetAddress(USBH_HandleTypeDef *phost, |
| 117 |
uint8_t DeviceAddress); |
| 118 |
|
| 119 |
USBH_StatusTypeDef USBH_SetInterface(USBH_HandleTypeDef *phost, |
| 120 |
uint8_t ep_num, uint8_t altSetting); |
| 121 |
|
| 122 |
USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, |
| 123 |
uint8_t ep_num); |
| 124 |
|
| 125 |
USBH_DescHeader_t *USBH_GetNextDesc (uint8_t *pbuf, |
| 126 |
uint16_t *ptr); |
| 127 |
/** |
| 128 |
* @} |
| 129 |
*/ |
| 130 |
|
| 131 |
#endif /* __USBH_CTLREQ_H */ |
| 132 |
|
| 133 |
/** |
| 134 |
* @} |
| 135 |
*/ |
| 136 |
|
| 137 |
/** |
| 138 |
* @} |
| 139 |
*/ |
| 140 |
|
| 141 |
/** |
| 142 |
* @} |
| 143 |
*/ |
| 144 |
|
| 145 |
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| 146 |
|
| 147 |
|