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