The official mbed C/C SDK provides the software platform and libraries to build your applications.

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Wed Jul 02 13:22:23 2014 +0100
Revision:
86:04dd9b1680ae
Release 86 of the mbed library

Main changes:


- bug fixes in various backends
- mbed "error" replaced by assert logic (mbed_assert)
- new ST Nucleo targets

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 86:04dd9b1680ae 1 /**
bogdanm 86:04dd9b1680ae 2 ******************************************************************************
bogdanm 86:04dd9b1680ae 3 * @file stm32f4xx_hal_pcd.h
bogdanm 86:04dd9b1680ae 4 * @author MCD Application Team
bogdanm 86:04dd9b1680ae 5 * @version V1.1.0
bogdanm 86:04dd9b1680ae 6 * @date 19-June-2014
bogdanm 86:04dd9b1680ae 7 * @brief Header file of PCD HAL module.
bogdanm 86:04dd9b1680ae 8 ******************************************************************************
bogdanm 86:04dd9b1680ae 9 * @attention
bogdanm 86:04dd9b1680ae 10 *
bogdanm 86:04dd9b1680ae 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 86:04dd9b1680ae 12 *
bogdanm 86:04dd9b1680ae 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 86:04dd9b1680ae 14 * are permitted provided that the following conditions are met:
bogdanm 86:04dd9b1680ae 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 86:04dd9b1680ae 16 * this list of conditions and the following disclaimer.
bogdanm 86:04dd9b1680ae 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 86:04dd9b1680ae 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 86:04dd9b1680ae 19 * and/or other materials provided with the distribution.
bogdanm 86:04dd9b1680ae 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 86:04dd9b1680ae 21 * may be used to endorse or promote products derived from this software
bogdanm 86:04dd9b1680ae 22 * without specific prior written permission.
bogdanm 86:04dd9b1680ae 23 *
bogdanm 86:04dd9b1680ae 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 86:04dd9b1680ae 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 86:04dd9b1680ae 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 86:04dd9b1680ae 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 86:04dd9b1680ae 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 86:04dd9b1680ae 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 86:04dd9b1680ae 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 86:04dd9b1680ae 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 86:04dd9b1680ae 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 86:04dd9b1680ae 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 86:04dd9b1680ae 34 *
bogdanm 86:04dd9b1680ae 35 ******************************************************************************
bogdanm 86:04dd9b1680ae 36 */
bogdanm 86:04dd9b1680ae 37
bogdanm 86:04dd9b1680ae 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 86:04dd9b1680ae 39 #ifndef __STM32F4xx_HAL_PCD_H
bogdanm 86:04dd9b1680ae 40 #define __STM32F4xx_HAL_PCD_H
bogdanm 86:04dd9b1680ae 41
bogdanm 86:04dd9b1680ae 42 #ifdef __cplusplus
bogdanm 86:04dd9b1680ae 43 extern "C" {
bogdanm 86:04dd9b1680ae 44 #endif
bogdanm 86:04dd9b1680ae 45
bogdanm 86:04dd9b1680ae 46 /* Includes ------------------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 47 #include "stm32f4xx_ll_usb.h"
bogdanm 86:04dd9b1680ae 48
bogdanm 86:04dd9b1680ae 49 /** @addtogroup STM32F4xx_HAL_Driver
bogdanm 86:04dd9b1680ae 50 * @{
bogdanm 86:04dd9b1680ae 51 */
bogdanm 86:04dd9b1680ae 52
bogdanm 86:04dd9b1680ae 53 /** @addtogroup PCD
bogdanm 86:04dd9b1680ae 54 * @{
bogdanm 86:04dd9b1680ae 55 */
bogdanm 86:04dd9b1680ae 56
bogdanm 86:04dd9b1680ae 57 /* Exported types ------------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 58
bogdanm 86:04dd9b1680ae 59 /**
bogdanm 86:04dd9b1680ae 60 * @brief PCD State structures definition
bogdanm 86:04dd9b1680ae 61 */
bogdanm 86:04dd9b1680ae 62 typedef enum
bogdanm 86:04dd9b1680ae 63 {
bogdanm 86:04dd9b1680ae 64 HAL_PCD_STATE_RESET = 0x00,
bogdanm 86:04dd9b1680ae 65 HAL_PCD_STATE_READY = 0x01,
bogdanm 86:04dd9b1680ae 66 HAL_PCD_STATE_ERROR = 0x02,
bogdanm 86:04dd9b1680ae 67 HAL_PCD_STATE_BUSY = 0x03,
bogdanm 86:04dd9b1680ae 68 HAL_PCD_STATE_TIMEOUT = 0x04
bogdanm 86:04dd9b1680ae 69 } PCD_StateTypeDef;
bogdanm 86:04dd9b1680ae 70
bogdanm 86:04dd9b1680ae 71
bogdanm 86:04dd9b1680ae 72 typedef USB_OTG_GlobalTypeDef PCD_TypeDef;
bogdanm 86:04dd9b1680ae 73 typedef USB_OTG_CfgTypeDef PCD_InitTypeDef;
bogdanm 86:04dd9b1680ae 74 typedef USB_OTG_EPTypeDef PCD_EPTypeDef ;
bogdanm 86:04dd9b1680ae 75
bogdanm 86:04dd9b1680ae 76 /**
bogdanm 86:04dd9b1680ae 77 * @brief PCD Handle Structure definition
bogdanm 86:04dd9b1680ae 78 */
bogdanm 86:04dd9b1680ae 79 typedef struct
bogdanm 86:04dd9b1680ae 80 {
bogdanm 86:04dd9b1680ae 81 PCD_TypeDef *Instance; /*!< Register base address */
bogdanm 86:04dd9b1680ae 82 PCD_InitTypeDef Init; /*!< PCD required parameters */
bogdanm 86:04dd9b1680ae 83 PCD_EPTypeDef IN_ep[15]; /*!< IN endpoint parameters */
bogdanm 86:04dd9b1680ae 84 PCD_EPTypeDef OUT_ep[15]; /*!< OUT endpoint parameters */
bogdanm 86:04dd9b1680ae 85 HAL_LockTypeDef Lock; /*!< PCD peripheral status */
bogdanm 86:04dd9b1680ae 86 __IO PCD_StateTypeDef State; /*!< PCD communication state */
bogdanm 86:04dd9b1680ae 87 uint32_t Setup[12]; /*!< Setup packet buffer */
bogdanm 86:04dd9b1680ae 88 void *pData; /*!< Pointer to upper stack Handler */
bogdanm 86:04dd9b1680ae 89
bogdanm 86:04dd9b1680ae 90 } PCD_HandleTypeDef;
bogdanm 86:04dd9b1680ae 91
bogdanm 86:04dd9b1680ae 92 /* Exported constants --------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 93 /** @defgroup PCD_Exported_Constants
bogdanm 86:04dd9b1680ae 94 * @{
bogdanm 86:04dd9b1680ae 95 */
bogdanm 86:04dd9b1680ae 96
bogdanm 86:04dd9b1680ae 97 /** @defgroup PCD_Speed
bogdanm 86:04dd9b1680ae 98 * @{
bogdanm 86:04dd9b1680ae 99 */
bogdanm 86:04dd9b1680ae 100 #define PCD_SPEED_HIGH 0
bogdanm 86:04dd9b1680ae 101 #define PCD_SPEED_HIGH_IN_FULL 1
bogdanm 86:04dd9b1680ae 102 #define PCD_SPEED_FULL 2
bogdanm 86:04dd9b1680ae 103 /**
bogdanm 86:04dd9b1680ae 104 * @}
bogdanm 86:04dd9b1680ae 105 */
bogdanm 86:04dd9b1680ae 106
bogdanm 86:04dd9b1680ae 107 /** @defgroup PCD_PHY_Module
bogdanm 86:04dd9b1680ae 108 * @{
bogdanm 86:04dd9b1680ae 109 */
bogdanm 86:04dd9b1680ae 110 #define PCD_PHY_ULPI 1
bogdanm 86:04dd9b1680ae 111 #define PCD_PHY_EMBEDDED 2
bogdanm 86:04dd9b1680ae 112 /**
bogdanm 86:04dd9b1680ae 113 * @}
bogdanm 86:04dd9b1680ae 114 */
bogdanm 86:04dd9b1680ae 115
bogdanm 86:04dd9b1680ae 116 /** @defgroup PCD_Instance_definition
bogdanm 86:04dd9b1680ae 117 * @{
bogdanm 86:04dd9b1680ae 118 */
bogdanm 86:04dd9b1680ae 119 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
bogdanm 86:04dd9b1680ae 120 #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
bogdanm 86:04dd9b1680ae 121 ((INSTANCE) == USB_OTG_HS))
bogdanm 86:04dd9b1680ae 122 #elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
bogdanm 86:04dd9b1680ae 123 #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS))
bogdanm 86:04dd9b1680ae 124 #endif
bogdanm 86:04dd9b1680ae 125
bogdanm 86:04dd9b1680ae 126 /**
bogdanm 86:04dd9b1680ae 127 * @}
bogdanm 86:04dd9b1680ae 128 */
bogdanm 86:04dd9b1680ae 129
bogdanm 86:04dd9b1680ae 130 /**
bogdanm 86:04dd9b1680ae 131 * @}
bogdanm 86:04dd9b1680ae 132 */
bogdanm 86:04dd9b1680ae 133
bogdanm 86:04dd9b1680ae 134 /* Exported macro ------------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 135
bogdanm 86:04dd9b1680ae 136 /** @defgroup PCD_Interrupt_Clock
bogdanm 86:04dd9b1680ae 137 * @brief macros to handle interrupts and specific clock configurations
bogdanm 86:04dd9b1680ae 138 * @{
bogdanm 86:04dd9b1680ae 139 */
bogdanm 86:04dd9b1680ae 140 #define __HAL_PCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance)
bogdanm 86:04dd9b1680ae 141 #define __HAL_PCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance)
bogdanm 86:04dd9b1680ae 142
bogdanm 86:04dd9b1680ae 143 #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__))
bogdanm 86:04dd9b1680ae 144 #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__))
bogdanm 86:04dd9b1680ae 145 #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0)
bogdanm 86:04dd9b1680ae 146
bogdanm 86:04dd9b1680ae 147
bogdanm 86:04dd9b1680ae 148 #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= \
bogdanm 86:04dd9b1680ae 149 ~(USB_OTG_PCGCCTL_STOPCLK)
bogdanm 86:04dd9b1680ae 150
bogdanm 86:04dd9b1680ae 151
bogdanm 86:04dd9b1680ae 152 #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK
bogdanm 86:04dd9b1680ae 153
bogdanm 86:04dd9b1680ae 154 #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE))&0x10)
bogdanm 86:04dd9b1680ae 155
bogdanm 86:04dd9b1680ae 156 #define USB_FS_EXTI_TRIGGER_RISING_EDGE ((uint32_t)0x08)
bogdanm 86:04dd9b1680ae 157 #define USB_FS_EXTI_TRIGGER_FALLING_EDGE ((uint32_t)0x0C)
bogdanm 86:04dd9b1680ae 158 #define USB_FS_EXTI_TRIGGER_BOTH_EDGE ((uint32_t)0x10)
bogdanm 86:04dd9b1680ae 159
bogdanm 86:04dd9b1680ae 160 #define USB_HS_EXTI_TRIGGER_RISING_EDGE ((uint32_t)0x08)
bogdanm 86:04dd9b1680ae 161 #define USB_HS_EXTI_TRIGGER_FALLING_EDGE ((uint32_t)0x0C)
bogdanm 86:04dd9b1680ae 162 #define USB_HS_EXTI_TRIGGER_BOTH_EDGE ((uint32_t)0x10)
bogdanm 86:04dd9b1680ae 163
bogdanm 86:04dd9b1680ae 164
bogdanm 86:04dd9b1680ae 165 #define USB_HS_EXTI_LINE_WAKEUP ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the USB HS EXTI Line */
bogdanm 86:04dd9b1680ae 166 #define USB_FS_EXTI_LINE_WAKEUP ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */
bogdanm 86:04dd9b1680ae 167
bogdanm 86:04dd9b1680ae 168
bogdanm 86:04dd9b1680ae 169
bogdanm 86:04dd9b1680ae 170 #define __HAL_USB_HS_EXTI_ENABLE_IT() EXTI->IMR |= (USB_HS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 171 #define __HAL_USB_HS_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_HS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 172 #define __HAL_USB_HS_EXTI_GET_FLAG() EXTI->PR & (USB_HS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 173 #define __HAL_USB_HS_EXTI_CLEAR_FLAG() EXTI->PR = (USB_HS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 174
bogdanm 86:04dd9b1680ae 175 #define __HAL_USB_HS_EXTI_SET_RISING_EGDE_TRIGGER() EXTI->FTSR &= ~(USB_HS_EXTI_LINE_WAKEUP);\
bogdanm 86:04dd9b1680ae 176 EXTI->RTSR |= USB_HS_EXTI_LINE_WAKEUP
bogdanm 86:04dd9b1680ae 177
bogdanm 86:04dd9b1680ae 178
bogdanm 86:04dd9b1680ae 179 #define __HAL_USB_HS_EXTI_SET_FALLING_EGDE_TRIGGER() EXTI->FTSR |= (USB_HS_EXTI_LINE_WAKEUP);\
bogdanm 86:04dd9b1680ae 180 EXTI->RTSR &= ~(USB_HS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 181
bogdanm 86:04dd9b1680ae 182
bogdanm 86:04dd9b1680ae 183 #define __HAL_USB_HS_EXTI_SET_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(USB_HS_EXTI_LINE_WAKEUP);\
bogdanm 86:04dd9b1680ae 184 EXTI->FTSR &= ~(USB_HS_EXTI_LINE_WAKEUP;)\
bogdanm 86:04dd9b1680ae 185 EXTI->RTSR |= USB_HS_EXTI_LINE_WAKEUP;\
bogdanm 86:04dd9b1680ae 186 EXTI->FTSR |= USB_HS_EXTI_LINE_WAKEUP
bogdanm 86:04dd9b1680ae 187
bogdanm 86:04dd9b1680ae 188 #define __HAL_USB_HS_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_FS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 189
bogdanm 86:04dd9b1680ae 190
bogdanm 86:04dd9b1680ae 191 #define __HAL_USB_FS_EXTI_ENABLE_IT() EXTI->IMR |= USB_FS_EXTI_LINE_WAKEUP
bogdanm 86:04dd9b1680ae 192 #define __HAL_USB_FS_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_FS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 193 #define __HAL_USB_FS_EXTI_GET_FLAG() EXTI->PR & (USB_FS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 194 #define __HAL_USB_FS_EXTI_CLEAR_FLAG() EXTI->PR = USB_FS_EXTI_LINE_WAKEUP
bogdanm 86:04dd9b1680ae 195
bogdanm 86:04dd9b1680ae 196 #define __HAL_USB_FS_EXTI_SET_RISING_EGDE_TRIGGER() EXTI->FTSR &= ~(USB_FS_EXTI_LINE_WAKEUP);\
bogdanm 86:04dd9b1680ae 197 EXTI->RTSR |= USB_FS_EXTI_LINE_WAKEUP
bogdanm 86:04dd9b1680ae 198
bogdanm 86:04dd9b1680ae 199
bogdanm 86:04dd9b1680ae 200 #define __HAL_USB_FS_EXTI_SET_FALLING_EGDE_TRIGGER() EXTI->FTSR |= (USB_FS_EXTI_LINE_WAKEUP);\
bogdanm 86:04dd9b1680ae 201 EXTI->RTSR &= ~(USB_FS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 202
bogdanm 86:04dd9b1680ae 203
bogdanm 86:04dd9b1680ae 204 #define __HAL_USB_FS_EXTI_SET_FALLINGRISING_TRIGGER() EXTI->RTSR &= ~(USB_FS_EXTI_LINE_WAKEUP);\
bogdanm 86:04dd9b1680ae 205 EXTI->FTSR &= ~(USB_FS_EXTI_LINE_WAKEUP);\
bogdanm 86:04dd9b1680ae 206 EXTI->RTSR |= USB_FS_EXTI_LINE_WAKEUP;\
bogdanm 86:04dd9b1680ae 207 EXTI->FTSR |= USB_FS_EXTI_LINE_WAKEUP
bogdanm 86:04dd9b1680ae 208
bogdanm 86:04dd9b1680ae 209 #define __HAL_USB_FS_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_FS_EXTI_LINE_WAKEUP)
bogdanm 86:04dd9b1680ae 210
bogdanm 86:04dd9b1680ae 211 /**
bogdanm 86:04dd9b1680ae 212 * @}
bogdanm 86:04dd9b1680ae 213 */
bogdanm 86:04dd9b1680ae 214
bogdanm 86:04dd9b1680ae 215 /* Include PCD HAL Extension module */
bogdanm 86:04dd9b1680ae 216 #include "stm32f4xx_hal_pcd_ex.h"
bogdanm 86:04dd9b1680ae 217
bogdanm 86:04dd9b1680ae 218 /* Exported functions --------------------------------------------------------*/
bogdanm 86:04dd9b1680ae 219
bogdanm 86:04dd9b1680ae 220 /* Initialization/de-initialization functions **********************************/
bogdanm 86:04dd9b1680ae 221 HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 222 HAL_StatusTypeDef HAL_PCD_DeInit (PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 223 void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 224 void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 225
bogdanm 86:04dd9b1680ae 226 /* I/O operation functions *****************************************************/
bogdanm 86:04dd9b1680ae 227 /* Non-Blocking mode: Interrupt */
bogdanm 86:04dd9b1680ae 228 HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 229 HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 230 void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 231
bogdanm 86:04dd9b1680ae 232 void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
bogdanm 86:04dd9b1680ae 233 void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
bogdanm 86:04dd9b1680ae 234 void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 235 void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 236 void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 237 void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 238 void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 239 void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
bogdanm 86:04dd9b1680ae 240 void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
bogdanm 86:04dd9b1680ae 241 void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 242 void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 243
bogdanm 86:04dd9b1680ae 244 /* Peripheral Control functions ************************************************/
bogdanm 86:04dd9b1680ae 245 HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 246 HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 247 HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address);
bogdanm 86:04dd9b1680ae 248 HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type);
bogdanm 86:04dd9b1680ae 249 HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
bogdanm 86:04dd9b1680ae 250 HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
bogdanm 86:04dd9b1680ae 251 HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
bogdanm 86:04dd9b1680ae 252 uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
bogdanm 86:04dd9b1680ae 253 HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
bogdanm 86:04dd9b1680ae 254 HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
bogdanm 86:04dd9b1680ae 255 HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
bogdanm 86:04dd9b1680ae 256 HAL_StatusTypeDef HAL_PCD_ActiveRemoteWakeup(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 257 HAL_StatusTypeDef HAL_PCD_DeActiveRemoteWakeup(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 258
bogdanm 86:04dd9b1680ae 259 /* Create an alias to keep compatibility with the old name */
bogdanm 86:04dd9b1680ae 260 #define HAL_PCD_SetTxFiFo HAL_PCDEx_SetTxFiFo
bogdanm 86:04dd9b1680ae 261 #define HAL_PCD_SetRxFiFo HAL_PCDEx_SetRxFiFo
bogdanm 86:04dd9b1680ae 262
bogdanm 86:04dd9b1680ae 263 /* Peripheral State functions **************************************************/
bogdanm 86:04dd9b1680ae 264 PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
bogdanm 86:04dd9b1680ae 265
bogdanm 86:04dd9b1680ae 266 /**
bogdanm 86:04dd9b1680ae 267 * @}
bogdanm 86:04dd9b1680ae 268 */
bogdanm 86:04dd9b1680ae 269
bogdanm 86:04dd9b1680ae 270 /**
bogdanm 86:04dd9b1680ae 271 * @}
bogdanm 86:04dd9b1680ae 272 */
bogdanm 86:04dd9b1680ae 273
bogdanm 86:04dd9b1680ae 274 #ifdef __cplusplus
bogdanm 86:04dd9b1680ae 275 }
bogdanm 86:04dd9b1680ae 276 #endif
bogdanm 86:04dd9b1680ae 277
bogdanm 86:04dd9b1680ae 278
bogdanm 86:04dd9b1680ae 279 #endif /* __STM32F4xx_HAL_PCD_H */
bogdanm 86:04dd9b1680ae 280
bogdanm 86:04dd9b1680ae 281 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/