1 /**
2   ******************************************************************************
3   * @file    stm32f2xx_hal_pcd.h
4   * @author  MCD Application Team
5   * @brief   Header file of PCD HAL module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2016 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32F2xx_HAL_PCD_H
21 #define STM32F2xx_HAL_PCD_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32f2xx_ll_usb.h"
29 
30 #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
31 
32 /** @addtogroup STM32F2xx_HAL_Driver
33   * @{
34   */
35 
36 /** @addtogroup PCD
37   * @{
38   */
39 
40 /* Exported types ------------------------------------------------------------*/
41 /** @defgroup PCD_Exported_Types PCD Exported Types
42   * @{
43   */
44 
45 /**
46   * @brief  PCD State structure definition
47   */
48 typedef enum
49 {
50   HAL_PCD_STATE_RESET   = 0x00,
51   HAL_PCD_STATE_READY   = 0x01,
52   HAL_PCD_STATE_ERROR   = 0x02,
53   HAL_PCD_STATE_BUSY    = 0x03,
54   HAL_PCD_STATE_TIMEOUT = 0x04
55 } PCD_StateTypeDef;
56 
57 /* Device LPM suspend state */
58 typedef enum
59 {
60   LPM_L0 = 0x00, /* on */
61   LPM_L1 = 0x01, /* LPM L1 sleep */
62   LPM_L2 = 0x02, /* suspend */
63   LPM_L3 = 0x03, /* off */
64 } PCD_LPM_StateTypeDef;
65 
66 typedef enum
67 {
68   PCD_LPM_L0_ACTIVE = 0x00, /* on */
69   PCD_LPM_L1_ACTIVE = 0x01, /* LPM L1 sleep */
70 } PCD_LPM_MsgTypeDef;
71 
72 typedef enum
73 {
74   PCD_BCD_ERROR                     = 0xFF,
75   PCD_BCD_CONTACT_DETECTION         = 0xFE,
76   PCD_BCD_STD_DOWNSTREAM_PORT       = 0xFD,
77   PCD_BCD_CHARGING_DOWNSTREAM_PORT  = 0xFC,
78   PCD_BCD_DEDICATED_CHARGING_PORT   = 0xFB,
79   PCD_BCD_DISCOVERY_COMPLETED       = 0x00,
80 
81 } PCD_BCD_MsgTypeDef;
82 
83 #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
84 typedef USB_OTG_GlobalTypeDef  PCD_TypeDef;
85 typedef USB_OTG_CfgTypeDef     PCD_InitTypeDef;
86 typedef USB_OTG_EPTypeDef      PCD_EPTypeDef;
87 #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
88 
89 /**
90   * @brief  PCD Handle Structure definition
91   */
92 #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
93 typedef struct __PCD_HandleTypeDef
94 #else
95 typedef struct
96 #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
97 {
98   PCD_TypeDef             *Instance;   /*!< Register base address             */
99   PCD_InitTypeDef         Init;        /*!< PCD required parameters           */
100   __IO uint8_t            USB_Address; /*!< USB Address                       */
101   PCD_EPTypeDef           IN_ep[16];   /*!< IN endpoint parameters            */
102   PCD_EPTypeDef           OUT_ep[16];  /*!< OUT endpoint parameters           */
103   HAL_LockTypeDef         Lock;        /*!< PCD peripheral status             */
104   __IO PCD_StateTypeDef   State;       /*!< PCD communication state           */
105   __IO  uint32_t          ErrorCode;   /*!< PCD Error code                    */
106   uint32_t                Setup[12];   /*!< Setup packet buffer               */
107   PCD_LPM_StateTypeDef    LPM_State;   /*!< LPM State                         */
108   uint32_t                BESL;
109   uint32_t                FrameNumber; /*!< Store Current Frame number        */
110 
111   void                    *pData;      /*!< Pointer to upper stack Handler */
112 
113 #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
114   void (* SOFCallback)(struct __PCD_HandleTypeDef *hpcd);                              /*!< USB OTG PCD SOF callback                */
115   void (* SetupStageCallback)(struct __PCD_HandleTypeDef *hpcd);                       /*!< USB OTG PCD Setup Stage callback        */
116   void (* ResetCallback)(struct __PCD_HandleTypeDef *hpcd);                            /*!< USB OTG PCD Reset callback              */
117   void (* SuspendCallback)(struct __PCD_HandleTypeDef *hpcd);                          /*!< USB OTG PCD Suspend callback            */
118   void (* ResumeCallback)(struct __PCD_HandleTypeDef *hpcd);                           /*!< USB OTG PCD Resume callback             */
119   void (* ConnectCallback)(struct __PCD_HandleTypeDef *hpcd);                          /*!< USB OTG PCD Connect callback            */
120   void (* DisconnectCallback)(struct __PCD_HandleTypeDef *hpcd);                       /*!< USB OTG PCD Disconnect callback         */
121 
122   void (* DataOutStageCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum);      /*!< USB OTG PCD Data OUT Stage callback     */
123   void (* DataInStageCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum);       /*!< USB OTG PCD Data IN Stage callback      */
124   void (* ISOOUTIncompleteCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum);  /*!< USB OTG PCD ISO OUT Incomplete callback */
125   void (* ISOINIncompleteCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum);   /*!< USB OTG PCD ISO IN Incomplete callback  */
126 
127   void (* MspInitCallback)(struct __PCD_HandleTypeDef *hpcd);                          /*!< USB OTG PCD Msp Init callback           */
128   void (* MspDeInitCallback)(struct __PCD_HandleTypeDef *hpcd);                        /*!< USB OTG PCD Msp DeInit callback         */
129 #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
130 } PCD_HandleTypeDef;
131 
132 /**
133   * @}
134   */
135 
136 /* Include PCD HAL Extended module */
137 #include "stm32f2xx_hal_pcd_ex.h"
138 
139 /* Exported constants --------------------------------------------------------*/
140 /** @defgroup PCD_Exported_Constants PCD Exported Constants
141   * @{
142   */
143 
144 /** @defgroup PCD_Speed PCD Speed
145   * @{
146   */
147 #define PCD_SPEED_HIGH               USBD_HS_SPEED
148 #define PCD_SPEED_HIGH_IN_FULL       USBD_HSINFS_SPEED
149 #define PCD_SPEED_FULL               USBD_FS_SPEED
150 /**
151   * @}
152   */
153 
154 /** @defgroup PCD_PHY_Module PCD PHY Module
155   * @{
156   */
157 #define PCD_PHY_ULPI                 1U
158 #define PCD_PHY_EMBEDDED             2U
159 #define PCD_PHY_UTMI                 3U
160 /**
161   * @}
162   */
163 
164 /** @defgroup PCD_Error_Code_definition PCD Error Code definition
165   * @brief  PCD Error Code definition
166   * @{
167   */
168 #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
169 #define  HAL_PCD_ERROR_INVALID_CALLBACK                        (0x00000010U)    /*!< Invalid Callback error  */
170 #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
171 
172 /**
173   * @}
174   */
175 
176 /**
177   * @}
178   */
179 
180 /* Exported macros -----------------------------------------------------------*/
181 /** @defgroup PCD_Exported_Macros PCD Exported Macros
182   *  @brief macros to handle interrupts and specific clock configurations
183   * @{
184   */
185 #define __HAL_PCD_ENABLE(__HANDLE__)                       (void)USB_EnableGlobalInt ((__HANDLE__)->Instance)
186 #define __HAL_PCD_DISABLE(__HANDLE__)                      (void)USB_DisableGlobalInt ((__HANDLE__)->Instance)
187 
188 #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) \
189   ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__))
190 
191 #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
192 #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__)    (((__HANDLE__)->Instance->GINTSTS) &= (__INTERRUPT__))
193 #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__)         (USB_ReadInterrupts((__HANDLE__)->Instance) == 0U)
194 
195 #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) \
196   *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= ~(USB_OTG_PCGCCTL_STOPCLK)
197 
198 #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) \
199   *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK
200 
201 #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) \
202   ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE)) & 0x10U)
203 
204 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT()    EXTI->IMR |= (USB_OTG_HS_WAKEUP_EXTI_LINE)
205 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT()   EXTI->IMR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
206 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG()     EXTI->PR & (USB_OTG_HS_WAKEUP_EXTI_LINE)
207 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG()   EXTI->PR = (USB_OTG_HS_WAKEUP_EXTI_LINE)
208 
209 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE() \
210   do { \
211     EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE); \
212     EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE; \
213   } while(0U)
214 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT()    EXTI->IMR |= USB_OTG_FS_WAKEUP_EXTI_LINE
215 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT()   EXTI->IMR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
216 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG()     EXTI->PR & (USB_OTG_FS_WAKEUP_EXTI_LINE)
217 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG()   EXTI->PR = USB_OTG_FS_WAKEUP_EXTI_LINE
218 
219 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE() \
220   do { \
221     EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE); \
222     EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE; \
223   } while(0U)
224 #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
225 
226 
227 /**
228   * @}
229   */
230 
231 /* Exported functions --------------------------------------------------------*/
232 /** @addtogroup PCD_Exported_Functions PCD Exported Functions
233   * @{
234   */
235 
236 /* Initialization/de-initialization functions  ********************************/
237 /** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions
238   * @{
239   */
240 HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd);
241 HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef *hpcd);
242 void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd);
243 void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd);
244 
245 #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
246 /** @defgroup HAL_PCD_Callback_ID_enumeration_definition HAL USB OTG PCD Callback ID enumeration definition
247   * @brief  HAL USB OTG PCD Callback ID enumeration definition
248   * @{
249   */
250 typedef enum
251 {
252   HAL_PCD_SOF_CB_ID          = 0x01,      /*!< USB PCD SOF callback ID          */
253   HAL_PCD_SETUPSTAGE_CB_ID   = 0x02,      /*!< USB PCD Setup Stage callback ID  */
254   HAL_PCD_RESET_CB_ID        = 0x03,      /*!< USB PCD Reset callback ID        */
255   HAL_PCD_SUSPEND_CB_ID      = 0x04,      /*!< USB PCD Suspend callback ID      */
256   HAL_PCD_RESUME_CB_ID       = 0x05,      /*!< USB PCD Resume callback ID       */
257   HAL_PCD_CONNECT_CB_ID      = 0x06,      /*!< USB PCD Connect callback ID      */
258   HAL_PCD_DISCONNECT_CB_ID   = 0x07,      /*!< USB PCD Disconnect callback ID   */
259 
260   HAL_PCD_MSPINIT_CB_ID      = 0x08,      /*!< USB PCD MspInit callback ID      */
261   HAL_PCD_MSPDEINIT_CB_ID    = 0x09       /*!< USB PCD MspDeInit callback ID    */
262 
263 } HAL_PCD_CallbackIDTypeDef;
264 /**
265   * @}
266   */
267 
268 /** @defgroup HAL_PCD_Callback_pointer_definition HAL USB OTG PCD Callback pointer definition
269   * @brief  HAL USB OTG PCD Callback pointer definition
270   * @{
271   */
272 
273 typedef void (*pPCD_CallbackTypeDef)(PCD_HandleTypeDef *hpcd);                                   /*!< pointer to a common USB OTG PCD callback function  */
274 typedef void (*pPCD_DataOutStageCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum);        /*!< pointer to USB OTG PCD Data OUT Stage callback     */
275 typedef void (*pPCD_DataInStageCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum);         /*!< pointer to USB OTG PCD Data IN Stage callback      */
276 typedef void (*pPCD_IsoOutIncpltCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum);        /*!< pointer to USB OTG PCD ISO OUT Incomplete callback */
277 typedef void (*pPCD_IsoInIncpltCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum);         /*!< pointer to USB OTG PCD ISO IN Incomplete callback  */
278 
279 /**
280   * @}
281   */
282 
283 HAL_StatusTypeDef HAL_PCD_RegisterCallback(PCD_HandleTypeDef *hpcd, HAL_PCD_CallbackIDTypeDef CallbackID,
284                                            pPCD_CallbackTypeDef pCallback);
285 
286 HAL_StatusTypeDef HAL_PCD_UnRegisterCallback(PCD_HandleTypeDef *hpcd, HAL_PCD_CallbackIDTypeDef CallbackID);
287 
288 HAL_StatusTypeDef HAL_PCD_RegisterDataOutStageCallback(PCD_HandleTypeDef *hpcd,
289                                                        pPCD_DataOutStageCallbackTypeDef pCallback);
290 
291 HAL_StatusTypeDef HAL_PCD_UnRegisterDataOutStageCallback(PCD_HandleTypeDef *hpcd);
292 
293 HAL_StatusTypeDef HAL_PCD_RegisterDataInStageCallback(PCD_HandleTypeDef *hpcd,
294                                                       pPCD_DataInStageCallbackTypeDef pCallback);
295 
296 HAL_StatusTypeDef HAL_PCD_UnRegisterDataInStageCallback(PCD_HandleTypeDef *hpcd);
297 
298 HAL_StatusTypeDef HAL_PCD_RegisterIsoOutIncpltCallback(PCD_HandleTypeDef *hpcd,
299                                                        pPCD_IsoOutIncpltCallbackTypeDef pCallback);
300 
301 HAL_StatusTypeDef HAL_PCD_UnRegisterIsoOutIncpltCallback(PCD_HandleTypeDef *hpcd);
302 
303 HAL_StatusTypeDef HAL_PCD_RegisterIsoInIncpltCallback(PCD_HandleTypeDef *hpcd,
304                                                       pPCD_IsoInIncpltCallbackTypeDef pCallback);
305 
306 HAL_StatusTypeDef HAL_PCD_UnRegisterIsoInIncpltCallback(PCD_HandleTypeDef *hpcd);
307 
308 #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
309 /**
310   * @}
311   */
312 
313 /* I/O operation functions  ***************************************************/
314 /* Non-Blocking mode: Interrupt */
315 /** @addtogroup PCD_Exported_Functions_Group2 Input and Output operation functions
316   * @{
317   */
318 HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd);
319 HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd);
320 void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd);
321 void HAL_PCD_WKUP_IRQHandler(PCD_HandleTypeDef *hpcd);
322 
323 void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd);
324 void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd);
325 void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd);
326 void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd);
327 void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd);
328 void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd);
329 void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd);
330 
331 void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
332 void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
333 void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
334 void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
335 /**
336   * @}
337   */
338 
339 /* Peripheral Control functions  **********************************************/
340 /** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions
341   * @{
342   */
343 HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd);
344 HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd);
345 HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address);
346 HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type);
347 HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
348 HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
349 HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
350 HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
351 HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
352 HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
353 HAL_StatusTypeDef HAL_PCD_EP_Abort(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
354 HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
355 HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
356 #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
357 HAL_StatusTypeDef HAL_PCD_SetTestMode(PCD_HandleTypeDef *hpcd, uint8_t testmode);
358 #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
359 
360 uint32_t          HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef const *hpcd, uint8_t ep_addr);
361 /**
362   * @}
363   */
364 
365 /* Peripheral State functions  ************************************************/
366 /** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
367   * @{
368   */
369 PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef const *hpcd);
370 /**
371   * @}
372   */
373 
374 /**
375   * @}
376   */
377 
378 /* Private constants ---------------------------------------------------------*/
379 /** @defgroup PCD_Private_Constants PCD Private Constants
380   * @{
381   */
382 /** @defgroup USB_EXTI_Line_Interrupt USB EXTI line interrupt
383   * @{
384   */
385 #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
386 #define USB_OTG_FS_WAKEUP_EXTI_LINE                                   (0x1U << 18)  /*!< USB FS EXTI Line WakeUp Interrupt */
387 #define USB_OTG_HS_WAKEUP_EXTI_LINE                                   (0x1U << 20)  /*!< USB HS EXTI Line WakeUp Interrupt */
388 #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
389 
390 
391 /**
392   * @}
393   */
394 /**
395   * @}
396   */
397 
398 #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
399 #ifndef USB_OTG_DOEPINT_OTEPSPR
400 #define USB_OTG_DOEPINT_OTEPSPR                (0x1UL << 5)      /*!< Status Phase Received interrupt */
401 #endif /* defined USB_OTG_DOEPINT_OTEPSPR */
402 
403 #ifndef USB_OTG_DOEPMSK_OTEPSPRM
404 #define USB_OTG_DOEPMSK_OTEPSPRM               (0x1UL << 5)      /*!< Setup Packet Received interrupt mask */
405 #endif /* defined USB_OTG_DOEPMSK_OTEPSPRM */
406 
407 #ifndef USB_OTG_DOEPINT_NAK
408 #define USB_OTG_DOEPINT_NAK                    (0x1UL << 13)      /*!< NAK interrupt */
409 #endif /* defined USB_OTG_DOEPINT_NAK */
410 
411 #ifndef USB_OTG_DOEPMSK_NAKM
412 #define USB_OTG_DOEPMSK_NAKM                   (0x1UL << 13)      /*!< OUT Packet NAK interrupt mask */
413 #endif /* defined USB_OTG_DOEPMSK_NAKM */
414 
415 #ifndef USB_OTG_DOEPINT_STPKTRX
416 #define USB_OTG_DOEPINT_STPKTRX                (0x1UL << 15)      /*!< Setup Packet Received interrupt */
417 #endif /* defined USB_OTG_DOEPINT_STPKTRX */
418 
419 #ifndef USB_OTG_DOEPMSK_NYETM
420 #define USB_OTG_DOEPMSK_NYETM                  (0x1UL << 14)      /*!< Setup Packet Received interrupt mask */
421 #endif /* defined USB_OTG_DOEPMSK_NYETM */
422 #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
423 
424 /* Private macros ------------------------------------------------------------*/
425 /** @defgroup PCD_Private_Macros PCD Private Macros
426   * @{
427   */
428 
429 /**
430   * @}
431   */
432 
433 /**
434   * @}
435   */
436 
437 /**
438   * @}
439   */
440 #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
441 
442 #ifdef __cplusplus
443 }
444 #endif
445 
446 #endif /* STM32F2xx_HAL_PCD_H */
447