Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2 | Rev 9 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | /** |
1 | /** |
| 2 | ****************************************************************************** |
2 | ****************************************************************************** |
| 3 | * @file usbd_core.h |
3 | * @file usbd_core.h |
| 4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
| 5 | * @version V2.4.2 |
- | |
| 6 | * @date 11-December-2015 |
- | |
| 7 | * @brief Header file for usbd_core.c file |
5 | * @brief Header file for usbd_core.c file |
| 8 | ****************************************************************************** |
6 | ****************************************************************************** |
| 9 | * @attention |
7 | * @attention |
| 10 | * |
8 | * |
| 11 | * <h2><center>© COPYRIGHT 2015 STMicroelectronics</center></h2> |
9 | * <h2><center>© Copyright (c) 2015 STMicroelectronics. |
| - | 10 | * All rights reserved.</center></h2> |
|
| 12 | * |
11 | * |
| 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
12 | * This software component is licensed by ST under Ultimate Liberty license |
| 14 | * You may not use this file except in compliance with the License. |
13 | * SLA0044, the "License"; You may not use this file except in compliance with |
| 15 | * You may obtain a copy of the License at: |
14 | * the License. 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. |
15 | * www.st.com/SLA0044 |
| 24 | * |
16 | * |
| 25 | ****************************************************************************** |
17 | ****************************************************************************** |
| 26 | */ |
18 | */ |
| 27 | 19 | ||
| 28 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| 29 | #ifndef __USBD_CORE_H |
21 | #ifndef __USBD_CORE_H |
| 30 | #define __USBD_CORE_H |
22 | #define __USBD_CORE_H |
| 31 | 23 | ||
| 32 | #ifdef __cplusplus |
24 | #ifdef __cplusplus |
| 33 | extern "C" { |
25 | extern "C" { |
| 34 | #endif |
26 | #endif |
| 35 | 27 | ||
| 36 | /* Includes ------------------------------------------------------------------*/ |
28 | /* Includes ------------------------------------------------------------------*/ |
| 37 | #include "usbd_conf.h" |
29 | #include "usbd_conf.h" |
| 38 | #include "usbd_def.h" |
30 | #include "usbd_def.h" |
| Line 40... | Line 32... | ||
| 40 | #include "usbd_ctlreq.h" |
32 | #include "usbd_ctlreq.h" |
| 41 | 33 | ||
| 42 | /** @addtogroup STM32_USB_DEVICE_LIBRARY |
34 | /** @addtogroup STM32_USB_DEVICE_LIBRARY |
| 43 | * @{ |
35 | * @{ |
| 44 | */ |
36 | */ |
| 45 | 37 | ||
| 46 | /** @defgroup USBD_CORE |
38 | /** @defgroup USBD_CORE |
| 47 | * @brief This file is the Header file for usbd_core.c file |
39 | * @brief This file is the Header file for usbd_core.c file |
| 48 | * @{ |
40 | * @{ |
| 49 | */ |
41 | */ |
| 50 | 42 | ||
| 51 | 43 | ||
| 52 | /** @defgroup USBD_CORE_Exported_Defines |
44 | /** @defgroup USBD_CORE_Exported_Defines |
| 53 | * @{ |
45 | * @{ |
| 54 | */ |
46 | */ |
| 55 | - | ||
| - | 47 | #ifndef USBD_DEBUG_LEVEL |
|
| - | 48 | #define USBD_DEBUG_LEVEL 0U |
|
| - | 49 | #endif /* USBD_DEBUG_LEVEL */ |
|
| 56 | /** |
50 | /** |
| 57 | * @} |
51 | * @} |
| 58 | */ |
52 | */ |
| 59 | 53 | ||
| 60 | 54 | ||
| 61 | /** @defgroup USBD_CORE_Exported_TypesDefinitions |
55 | /** @defgroup USBD_CORE_Exported_TypesDefinitions |
| 62 | * @{ |
56 | * @{ |
| 63 | */ |
57 | */ |
| 64 | 58 | ||
| 65 | 59 | ||
| 66 | /** |
60 | /** |
| 67 | * @} |
61 | * @} |
| 68 | */ |
62 | */ |
| 69 | 63 | ||
| 70 | 64 | ||
| 71 | 65 | ||
| 72 | /** @defgroup USBD_CORE_Exported_Macros |
66 | /** @defgroup USBD_CORE_Exported_Macros |
| 73 | * @{ |
67 | * @{ |
| 74 | */ |
68 | */ |
| 75 | 69 | ||
| 76 | /** |
70 | /** |
| 77 | * @} |
71 | * @} |
| 78 | */ |
72 | */ |
| 79 | 73 | ||
| 80 | /** @defgroup USBD_CORE_Exported_Variables |
74 | /** @defgroup USBD_CORE_Exported_Variables |
| 81 | * @{ |
75 | * @{ |
| 82 | */ |
76 | */ |
| 83 | #define USBD_SOF USBD_LL_SOF |
77 | #define USBD_SOF USBD_LL_SOF |
| 84 | /** |
78 | /** |
| 85 | * @} |
79 | * @} |
| 86 | */ |
80 | */ |
| 87 | 81 | ||
| 88 | /** @defgroup USBD_CORE_Exported_FunctionsPrototype |
82 | /** @defgroup USBD_CORE_Exported_FunctionsPrototype |
| 89 | * @{ |
83 | * @{ |
| 90 | */ |
84 | */ |
| 91 | USBD_StatusTypeDef USBD_Init(USBD_HandleTypeDef *pdev, USBD_DescriptorsTypeDef *pdesc, uint8_t id); |
85 | USBD_StatusTypeDef USBD_Init(USBD_HandleTypeDef *pdev, USBD_DescriptorsTypeDef *pdesc, uint8_t id); |
| 92 | USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev); |
86 | USBD_StatusTypeDef USBD_DeInit(USBD_HandleTypeDef *pdev); |
| 93 | USBD_StatusTypeDef USBD_Start (USBD_HandleTypeDef *pdev); |
87 | USBD_StatusTypeDef USBD_Start(USBD_HandleTypeDef *pdev); |
| 94 | USBD_StatusTypeDef USBD_Stop (USBD_HandleTypeDef *pdev); |
88 | USBD_StatusTypeDef USBD_Stop(USBD_HandleTypeDef *pdev); |
| 95 | USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass); |
89 | USBD_StatusTypeDef USBD_RegisterClass(USBD_HandleTypeDef *pdev, USBD_ClassTypeDef *pclass); |
| 96 | 90 | ||
| 97 | USBD_StatusTypeDef USBD_RunTestMode (USBD_HandleTypeDef *pdev); |
91 | USBD_StatusTypeDef USBD_RunTestMode(USBD_HandleTypeDef *pdev); |
| 98 | USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx); |
92 | USBD_StatusTypeDef USBD_SetClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx); |
| 99 | USBD_StatusTypeDef USBD_ClrClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx); |
93 | USBD_StatusTypeDef USBD_ClrClassConfig(USBD_HandleTypeDef *pdev, uint8_t cfgidx); |
| 100 | 94 | ||
| 101 | USBD_StatusTypeDef USBD_LL_SetupStage(USBD_HandleTypeDef *pdev, uint8_t *psetup); |
95 | USBD_StatusTypeDef USBD_LL_SetupStage(USBD_HandleTypeDef *pdev, uint8_t *psetup); |
| 102 | USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev , uint8_t epnum, uint8_t *pdata); |
96 | USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata); |
| 103 | USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev , uint8_t epnum, uint8_t *pdata); |
97 | USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata); |
| 104 | 98 | ||
| 105 | USBD_StatusTypeDef USBD_LL_Reset(USBD_HandleTypeDef *pdev); |
99 | USBD_StatusTypeDef USBD_LL_Reset(USBD_HandleTypeDef *pdev); |
| 106 | USBD_StatusTypeDef USBD_LL_SetSpeed(USBD_HandleTypeDef *pdev, USBD_SpeedTypeDef speed); |
100 | USBD_StatusTypeDef USBD_LL_SetSpeed(USBD_HandleTypeDef *pdev, USBD_SpeedTypeDef speed); |
| 107 | USBD_StatusTypeDef USBD_LL_Suspend(USBD_HandleTypeDef *pdev); |
101 | USBD_StatusTypeDef USBD_LL_Suspend(USBD_HandleTypeDef *pdev); |
| 108 | USBD_StatusTypeDef USBD_LL_Resume(USBD_HandleTypeDef *pdev); |
102 | USBD_StatusTypeDef USBD_LL_Resume(USBD_HandleTypeDef *pdev); |
| Line 113... | Line 107... | ||
| 113 | 107 | ||
| 114 | USBD_StatusTypeDef USBD_LL_DevConnected(USBD_HandleTypeDef *pdev); |
108 | USBD_StatusTypeDef USBD_LL_DevConnected(USBD_HandleTypeDef *pdev); |
| 115 | USBD_StatusTypeDef USBD_LL_DevDisconnected(USBD_HandleTypeDef *pdev); |
109 | USBD_StatusTypeDef USBD_LL_DevDisconnected(USBD_HandleTypeDef *pdev); |
| 116 | 110 | ||
| 117 | /* USBD Low Level Driver */ |
111 | /* USBD Low Level Driver */ |
| 118 | USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev); |
112 | USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev); |
| 119 | USBD_StatusTypeDef USBD_LL_DeInit (USBD_HandleTypeDef *pdev); |
113 | USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev); |
| 120 | USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev); |
114 | USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev); |
| 121 | USBD_StatusTypeDef USBD_LL_Stop (USBD_HandleTypeDef *pdev); |
115 | USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev); |
| 122 | USBD_StatusTypeDef USBD_LL_OpenEP (USBD_HandleTypeDef *pdev, |
116 | USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, |
| 123 | uint8_t ep_addr, |
117 | uint8_t ep_addr, |
| 124 | uint8_t ep_type, |
118 | uint8_t ep_type, |
| 125 | uint16_t ep_mps); |
119 | uint16_t ep_mps); |
| 126 | 120 | ||
| 127 | USBD_StatusTypeDef USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
121 | USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
| 128 | USBD_StatusTypeDef USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
122 | USBD_StatusTypeDef USBD_LL_FlushEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
| 129 | USBD_StatusTypeDef USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
123 | USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
| 130 | USBD_StatusTypeDef USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
124 | USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
| 131 | uint8_t USBD_LL_IsStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
125 | uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
| 132 | USBD_StatusTypeDef USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t dev_addr); |
126 | USBD_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr); |
| 133 | USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev, |
127 | USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, |
| 134 | uint8_t ep_addr, |
128 | uint8_t ep_addr, |
| 135 | uint8_t *pbuf, |
129 | uint8_t *pbuf, |
| 136 | uint16_t size); |
130 | uint16_t size); |
| 137 | 131 | ||
| 138 | USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, |
132 | USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, |
| 139 | uint8_t ep_addr, |
133 | uint8_t ep_addr, |
| 140 | uint8_t *pbuf, |
134 | uint8_t *pbuf, |
| 141 | uint16_t size); |
135 | uint16_t size); |
| 142 | 136 | ||
| 143 | uint32_t USBD_LL_GetRxDataSize (USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
137 | uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr); |
| 144 | void USBD_LL_Delay (uint32_t Delay); |
138 | void USBD_LL_Delay(uint32_t Delay); |
| 145 | 139 | ||
| 146 | /** |
140 | /** |
| 147 | * @} |
141 | * @} |
| 148 | */ |
142 | */ |
| 149 | 143 | ||
| 150 | #ifdef __cplusplus |
144 | #ifdef __cplusplus |
| 151 | } |
145 | } |
| 152 | #endif |
146 | #endif |
| 153 | 147 | ||
| 154 | #endif /* __USBD_CORE_H */ |
148 | #endif /* __USBD_CORE_H */ |
| 155 | 149 | ||
| 156 | /** |
150 | /** |
| 157 | * @} |
151 | * @} |
| 158 | */ |
152 | */ |
| 159 | 153 | ||
| 160 | /** |
154 | /** |
| 161 | * @} |
155 | * @} |
| 162 | */ |
156 | */ |
| 163 | 157 | ||
| 164 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
158 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| 165 | 159 | ||
| 166 | 160 | ||
| 167 | 161 | ||