Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
110:165afa46840b
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 110:165afa46840b 1 /**
Kojto 110:165afa46840b 2 ******************************************************************************
Kojto 110:165afa46840b 3 * @file stm32f4xx_hal_pcd.h
Kojto 110:165afa46840b 4 * @author MCD Application Team
Kojto 110:165afa46840b 5 * @version V1.4.1
Kojto 110:165afa46840b 6 * @date 09-October-2015
Kojto 110:165afa46840b 7 * @brief Header file of PCD HAL module.
Kojto 110:165afa46840b 8 ******************************************************************************
Kojto 110:165afa46840b 9 * @attention
Kojto 110:165afa46840b 10 *
Kojto 110:165afa46840b 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 110:165afa46840b 12 *
Kojto 110:165afa46840b 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 110:165afa46840b 14 * are permitted provided that the following conditions are met:
Kojto 110:165afa46840b 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 110:165afa46840b 16 * this list of conditions and the following disclaimer.
Kojto 110:165afa46840b 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 110:165afa46840b 18 * this list of conditions and the following disclaimer in the documentation
Kojto 110:165afa46840b 19 * and/or other materials provided with the distribution.
Kojto 110:165afa46840b 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 110:165afa46840b 21 * may be used to endorse or promote products derived from this software
Kojto 110:165afa46840b 22 * without specific prior written permission.
Kojto 110:165afa46840b 23 *
Kojto 110:165afa46840b 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 110:165afa46840b 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 110:165afa46840b 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 110:165afa46840b 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 110:165afa46840b 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 110:165afa46840b 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 110:165afa46840b 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 110:165afa46840b 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 110:165afa46840b 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 110:165afa46840b 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 110:165afa46840b 34 *
Kojto 110:165afa46840b 35 ******************************************************************************
Kojto 110:165afa46840b 36 */
Kojto 110:165afa46840b 37
Kojto 110:165afa46840b 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 110:165afa46840b 39 #ifndef __STM32F4xx_HAL_PCD_H
Kojto 110:165afa46840b 40 #define __STM32F4xx_HAL_PCD_H
Kojto 110:165afa46840b 41
Kojto 110:165afa46840b 42 #ifdef __cplusplus
Kojto 110:165afa46840b 43 extern "C" {
Kojto 110:165afa46840b 44 #endif
Kojto 110:165afa46840b 45 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
Kojto 110:165afa46840b 46 defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
Kojto 110:165afa46840b 47 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) || \
Kojto 110:165afa46840b 48 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 110:165afa46840b 49 /* Includes ------------------------------------------------------------------*/
Kojto 110:165afa46840b 50 #include "stm32f4xx_ll_usb.h"
Kojto 110:165afa46840b 51
Kojto 110:165afa46840b 52 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 110:165afa46840b 53 * @{
Kojto 110:165afa46840b 54 */
Kojto 110:165afa46840b 55
Kojto 110:165afa46840b 56 /** @addtogroup PCD
Kojto 110:165afa46840b 57 * @{
Kojto 110:165afa46840b 58 */
Kojto 110:165afa46840b 59
Kojto 110:165afa46840b 60 /* Exported types ------------------------------------------------------------*/
Kojto 110:165afa46840b 61 /** @defgroup PCD_Exported_Types PCD Exported Types
Kojto 110:165afa46840b 62 * @{
Kojto 110:165afa46840b 63 */
Kojto 110:165afa46840b 64
Kojto 110:165afa46840b 65 /**
Kojto 110:165afa46840b 66 * @brief PCD State structure definition
Kojto 110:165afa46840b 67 */
Kojto 110:165afa46840b 68 typedef enum
Kojto 110:165afa46840b 69 {
Kojto 110:165afa46840b 70 HAL_PCD_STATE_RESET = 0x00,
Kojto 110:165afa46840b 71 HAL_PCD_STATE_READY = 0x01,
Kojto 110:165afa46840b 72 HAL_PCD_STATE_ERROR = 0x02,
Kojto 110:165afa46840b 73 HAL_PCD_STATE_BUSY = 0x03,
Kojto 110:165afa46840b 74 HAL_PCD_STATE_TIMEOUT = 0x04
Kojto 110:165afa46840b 75 } PCD_StateTypeDef;
Kojto 110:165afa46840b 76
Kojto 110:165afa46840b 77 #ifdef USB_OTG_GLPMCFG_LPMEN
Kojto 110:165afa46840b 78 /* Device LPM suspend state */
Kojto 110:165afa46840b 79 typedef enum
Kojto 110:165afa46840b 80 {
Kojto 110:165afa46840b 81 LPM_L0 = 0x00, /* on */
Kojto 110:165afa46840b 82 LPM_L1 = 0x01, /* LPM L1 sleep */
Kojto 110:165afa46840b 83 LPM_L2 = 0x02, /* suspend */
Kojto 110:165afa46840b 84 LPM_L3 = 0x03, /* off */
Kojto 110:165afa46840b 85 }PCD_LPM_StateTypeDef;
Kojto 110:165afa46840b 86 #endif /* USB_OTG_GLPMCFG_LPMEN */
Kojto 110:165afa46840b 87
Kojto 110:165afa46840b 88 typedef USB_OTG_GlobalTypeDef PCD_TypeDef;
Kojto 110:165afa46840b 89 typedef USB_OTG_CfgTypeDef PCD_InitTypeDef;
Kojto 110:165afa46840b 90 typedef USB_OTG_EPTypeDef PCD_EPTypeDef ;
Kojto 110:165afa46840b 91
Kojto 110:165afa46840b 92 /**
Kojto 110:165afa46840b 93 * @brief PCD Handle Structure definition
Kojto 110:165afa46840b 94 */
Kojto 110:165afa46840b 95 typedef struct
Kojto 110:165afa46840b 96 {
Kojto 110:165afa46840b 97 PCD_TypeDef *Instance; /*!< Register base address */
Kojto 110:165afa46840b 98 PCD_InitTypeDef Init; /*!< PCD required parameters */
Kojto 110:165afa46840b 99 PCD_EPTypeDef IN_ep[15]; /*!< IN endpoint parameters */
Kojto 110:165afa46840b 100 PCD_EPTypeDef OUT_ep[15]; /*!< OUT endpoint parameters */
Kojto 110:165afa46840b 101 HAL_LockTypeDef Lock; /*!< PCD peripheral status */
Kojto 110:165afa46840b 102 __IO PCD_StateTypeDef State; /*!< PCD communication state */
Kojto 110:165afa46840b 103 uint32_t Setup[12]; /*!< Setup packet buffer */
Kojto 110:165afa46840b 104 #ifdef USB_OTG_GLPMCFG_LPMEN
Kojto 110:165afa46840b 105 PCD_LPM_StateTypeDef LPM_State; /*!< LPM State */
Kojto 110:165afa46840b 106 uint32_t BESL;
Kojto 110:165afa46840b 107 uint32_t lpm_active; /*!< Enable or disable the Link Power Management .
Kojto 110:165afa46840b 108 This parameter can be set to ENABLE or DISABLE */
Kojto 110:165afa46840b 109 #endif /* USB_OTG_GLPMCFG_LPMEN */
Kojto 110:165afa46840b 110 #ifdef USB_OTG_GCCFG_BCDEN
Kojto 110:165afa46840b 111 uint32_t battery_charging_active; /*!< Enable or disable Battery charging.
Kojto 110:165afa46840b 112 This parameter can be set to ENABLE or DISABLE */
Kojto 110:165afa46840b 113 #endif /* USB_OTG_GCCFG_BCDEN */
Kojto 110:165afa46840b 114 void *pData; /*!< Pointer to upper stack Handler */
Kojto 110:165afa46840b 115 } PCD_HandleTypeDef;
Kojto 110:165afa46840b 116
Kojto 110:165afa46840b 117 /**
Kojto 110:165afa46840b 118 * @}
Kojto 110:165afa46840b 119 */
Kojto 110:165afa46840b 120
Kojto 110:165afa46840b 121 /* Include PCD HAL Extension module */
Kojto 110:165afa46840b 122 #include "stm32f4xx_hal_pcd_ex.h"
Kojto 110:165afa46840b 123
Kojto 110:165afa46840b 124 /* Exported constants --------------------------------------------------------*/
Kojto 110:165afa46840b 125 /** @defgroup PCD_Exported_Constants PCD Exported Constants
Kojto 110:165afa46840b 126 * @{
Kojto 110:165afa46840b 127 */
Kojto 110:165afa46840b 128
Kojto 110:165afa46840b 129 /** @defgroup PCD_Speed PCD Speed
Kojto 110:165afa46840b 130 * @{
Kojto 110:165afa46840b 131 */
Kojto 110:165afa46840b 132 #define PCD_SPEED_HIGH 0
Kojto 110:165afa46840b 133 #define PCD_SPEED_HIGH_IN_FULL 1
Kojto 110:165afa46840b 134 #define PCD_SPEED_FULL 2
Kojto 110:165afa46840b 135 /**
Kojto 110:165afa46840b 136 * @}
Kojto 110:165afa46840b 137 */
Kojto 110:165afa46840b 138
Kojto 110:165afa46840b 139 /** @defgroup PCD_PHY_Module PCD PHY Module
Kojto 110:165afa46840b 140 * @{
Kojto 110:165afa46840b 141 */
Kojto 110:165afa46840b 142 #define PCD_PHY_ULPI 1
Kojto 110:165afa46840b 143 #define PCD_PHY_EMBEDDED 2
Kojto 110:165afa46840b 144 /**
Kojto 110:165afa46840b 145 * @}
Kojto 110:165afa46840b 146 */
Kojto 110:165afa46840b 147
Kojto 110:165afa46840b 148 /** @defgroup PCD_Turnaround_Timeout Turnaround Timeout Value
Kojto 110:165afa46840b 149 * @{
Kojto 110:165afa46840b 150 */
Kojto 110:165afa46840b 151 #ifndef USBD_HS_TRDT_VALUE
Kojto 110:165afa46840b 152 #define USBD_HS_TRDT_VALUE 9
Kojto 110:165afa46840b 153 #endif /* USBD_HS_TRDT_VALUE */
Kojto 110:165afa46840b 154 #ifndef USBD_FS_TRDT_VALUE
Kojto 110:165afa46840b 155 #define USBD_FS_TRDT_VALUE 5
Kojto 110:165afa46840b 156 #endif /* USBD_FS_TRDT_VALUE */
Kojto 110:165afa46840b 157 /**
Kojto 110:165afa46840b 158 * @}
Kojto 110:165afa46840b 159 */
Kojto 110:165afa46840b 160
Kojto 110:165afa46840b 161 /**
Kojto 110:165afa46840b 162 * @}
Kojto 110:165afa46840b 163 */
Kojto 110:165afa46840b 164
Kojto 110:165afa46840b 165 /* Exported macros -----------------------------------------------------------*/
Kojto 110:165afa46840b 166 /** @defgroup PCD_Exported_Macros PCD Exported Macros
Kojto 110:165afa46840b 167 * @brief macros to handle interrupts and specific clock configurations
Kojto 110:165afa46840b 168 * @{
Kojto 110:165afa46840b 169 */
Kojto 110:165afa46840b 170 #define __HAL_PCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance)
Kojto 110:165afa46840b 171 #define __HAL_PCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance)
Kojto 110:165afa46840b 172
Kojto 110:165afa46840b 173 #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__))
Kojto 110:165afa46840b 174 #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) &= (__INTERRUPT__))
Kojto 110:165afa46840b 175 #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0)
Kojto 110:165afa46840b 176
Kojto 110:165afa46840b 177
Kojto 110:165afa46840b 178 #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= \
Kojto 110:165afa46840b 179 ~(USB_OTG_PCGCCTL_STOPCLK)
Kojto 110:165afa46840b 180
Kojto 110:165afa46840b 181 #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK
Kojto 110:165afa46840b 182
Kojto 110:165afa46840b 183 #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE))&0x10)
Kojto 110:165afa46840b 184
Kojto 110:165afa46840b 185 #define USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08)
Kojto 110:165afa46840b 186 #define USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C)
Kojto 110:165afa46840b 187 #define USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10)
Kojto 110:165afa46840b 188
Kojto 110:165afa46840b 189 #define USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08)
Kojto 110:165afa46840b 190 #define USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C)
Kojto 110:165afa46840b 191 #define USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10)
Kojto 110:165afa46840b 192
Kojto 110:165afa46840b 193 #define USB_OTG_HS_WAKEUP_EXTI_LINE ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the USB HS EXTI Line */
Kojto 110:165afa46840b 194 #define USB_OTG_FS_WAKEUP_EXTI_LINE ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */
Kojto 110:165afa46840b 195
Kojto 110:165afa46840b 196 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (USB_OTG_HS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 197 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 198 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_HS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 199 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (USB_OTG_HS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 200
Kojto 110:165afa46840b 201 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\
Kojto 110:165afa46840b 202 EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE
Kojto 110:165afa46840b 203
Kojto 110:165afa46840b 204 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_HS_WAKEUP_EXTI_LINE);\
Kojto 110:165afa46840b 205 EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 206
Kojto 110:165afa46840b 207 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\
Kojto 110:165afa46840b 208 EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE;)\
Kojto 110:165afa46840b 209 EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE;\
Kojto 110:165afa46840b 210 EXTI->FTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE
Kojto 110:165afa46840b 211
Kojto 110:165afa46840b 212 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 213
Kojto 110:165afa46840b 214 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= USB_OTG_FS_WAKEUP_EXTI_LINE
Kojto 110:165afa46840b 215 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 216 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_FS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 217 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = USB_OTG_FS_WAKEUP_EXTI_LINE
Kojto 110:165afa46840b 218
Kojto 110:165afa46840b 219 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
Kojto 110:165afa46840b 220 EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE
Kojto 110:165afa46840b 221
Kojto 110:165afa46840b 222
Kojto 110:165afa46840b 223 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_FS_WAKEUP_EXTI_LINE);\
Kojto 110:165afa46840b 224 EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 225
Kojto 110:165afa46840b 226 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
Kojto 110:165afa46840b 227 EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
Kojto 110:165afa46840b 228 EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE;\
Kojto 110:165afa46840b 229 EXTI->FTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE
Kojto 110:165afa46840b 230
Kojto 110:165afa46840b 231 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE)
Kojto 110:165afa46840b 232 /**
Kojto 110:165afa46840b 233 * @}
Kojto 110:165afa46840b 234 */
Kojto 110:165afa46840b 235
Kojto 110:165afa46840b 236 /* Exported functions --------------------------------------------------------*/
Kojto 110:165afa46840b 237 /** @addtogroup PCD_Exported_Functions PCD Exported Functions
Kojto 110:165afa46840b 238 * @{
Kojto 110:165afa46840b 239 */
Kojto 110:165afa46840b 240
Kojto 110:165afa46840b 241 /* Initialization/de-initialization functions ********************************/
Kojto 110:165afa46840b 242 /** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions
Kojto 110:165afa46840b 243 * @{
Kojto 110:165afa46840b 244 */
Kojto 110:165afa46840b 245 HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 246 HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 247 void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 248 void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 249 /**
Kojto 110:165afa46840b 250 * @}
Kojto 110:165afa46840b 251 */
Kojto 110:165afa46840b 252
Kojto 110:165afa46840b 253 /* I/O operation functions ***************************************************/
Kojto 110:165afa46840b 254 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 255 /** @addtogroup PCD_Exported_Functions_Group2 Input and Output operation functions
Kojto 110:165afa46840b 256 * @{
Kojto 110:165afa46840b 257 */
Kojto 110:165afa46840b 258 /* Non-Blocking mode: Interrupt */
Kojto 110:165afa46840b 259 HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 260 HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 261 void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 262
Kojto 110:165afa46840b 263 void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 110:165afa46840b 264 void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 110:165afa46840b 265 void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 266 void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 267 void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 268 void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 269 void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 270 void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 110:165afa46840b 271 void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 110:165afa46840b 272 void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 273 void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 274 /**
Kojto 110:165afa46840b 275 * @}
Kojto 110:165afa46840b 276 */
Kojto 110:165afa46840b 277
Kojto 110:165afa46840b 278 /* Peripheral Control functions **********************************************/
Kojto 110:165afa46840b 279 /** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions
Kojto 110:165afa46840b 280 * @{
Kojto 110:165afa46840b 281 */
Kojto 110:165afa46840b 282 HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 283 HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 284 HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address);
Kojto 110:165afa46840b 285 HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type);
Kojto 110:165afa46840b 286 HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 110:165afa46840b 287 HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
Kojto 110:165afa46840b 288 HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
Kojto 110:165afa46840b 289 uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 110:165afa46840b 290 HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 110:165afa46840b 291 HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 110:165afa46840b 292 HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 110:165afa46840b 293 HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 294 HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 295 /**
Kojto 110:165afa46840b 296 * @}
Kojto 110:165afa46840b 297 */
Kojto 110:165afa46840b 298
Kojto 110:165afa46840b 299 /* Peripheral State functions ************************************************/
Kojto 110:165afa46840b 300 /** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
Kojto 110:165afa46840b 301 * @{
Kojto 110:165afa46840b 302 */
Kojto 110:165afa46840b 303 PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
Kojto 110:165afa46840b 304 /**
Kojto 110:165afa46840b 305 * @}
Kojto 110:165afa46840b 306 */
Kojto 110:165afa46840b 307
Kojto 110:165afa46840b 308 /**
Kojto 110:165afa46840b 309 * @}
Kojto 110:165afa46840b 310 */
Kojto 110:165afa46840b 311
Kojto 110:165afa46840b 312 /* Private macros ------------------------------------------------------------*/
Kojto 110:165afa46840b 313 /** @defgroup PCD_Private_Macros PCD Private Macros
Kojto 110:165afa46840b 314 * @{
Kojto 110:165afa46840b 315 */
Kojto 110:165afa46840b 316 /** @defgroup PCD_Instance_definition PCD Instance definition
Kojto 110:165afa46840b 317 * @{
Kojto 110:165afa46840b 318 */
Kojto 110:165afa46840b 319 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\
Kojto 110:165afa46840b 320 defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 110:165afa46840b 321 #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
Kojto 110:165afa46840b 322 ((INSTANCE) == USB_OTG_HS))
Kojto 110:165afa46840b 323 #elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
Kojto 110:165afa46840b 324 #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS))
Kojto 110:165afa46840b 325 #endif
Kojto 110:165afa46840b 326 /**
Kojto 110:165afa46840b 327 * @}
Kojto 110:165afa46840b 328 */
Kojto 110:165afa46840b 329
Kojto 110:165afa46840b 330 /**
Kojto 110:165afa46840b 331 * @}
Kojto 110:165afa46840b 332 */
Kojto 110:165afa46840b 333
Kojto 110:165afa46840b 334 /**
Kojto 110:165afa46840b 335 * @}
Kojto 110:165afa46840b 336 */
Kojto 110:165afa46840b 337
Kojto 110:165afa46840b 338 /**
Kojto 110:165afa46840b 339 * @}
Kojto 110:165afa46840b 340 */
Kojto 110:165afa46840b 341 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||
Kojto 110:165afa46840b 342 STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 110:165afa46840b 343 #ifdef __cplusplus
Kojto 110:165afa46840b 344 }
Kojto 110:165afa46840b 345 #endif
Kojto 110:165afa46840b 346
Kojto 110:165afa46840b 347
Kojto 110:165afa46840b 348 #endif /* __STM32F4xx_HAL_PCD_H */
Kojto 110:165afa46840b 349
Kojto 110:165afa46840b 350 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/