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_F411RE/stm32f4xx_hal_pcd.h@110:165afa46840b, 2015-11-25 (annotated)
- Committer:
- Kojto
- Date:
- Wed Nov 25 13:21:40 2015 +0000
- Revision:
- 110:165afa46840b
- Parent:
- 106:ba1f97679dad
Release 110 of the mbed library
Changes:
- new platforms - STM32F410R, DISCO_F429ZI, DISCO_F469NI
- Nucleo L476 - gcc and uvision template
- k22,k64f targets - ADC channels A addition
- EFM32 - bugfixes in sleep, serial and spi
- Delta DFCM NNN40 - pinnames update
Who changed what in which revision?
User | Revision | Line number | New 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 |
Kojto | 110:165afa46840b | 5 | * @version V1.4.1 |
Kojto | 110:165afa46840b | 6 | * @date 09-October-2015 |
bogdanm | 86:04dd9b1680ae | 7 | * @brief Header file of PCD HAL module. |
bogdanm | 86:04dd9b1680ae | 8 | ****************************************************************************** |
bogdanm | 86:04dd9b1680ae | 9 | * @attention |
bogdanm | 86:04dd9b1680ae | 10 | * |
Kojto | 99:dbbf35b96557 | 11 | * <h2><center>© COPYRIGHT(c) 2015 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 |
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) |
bogdanm | 86:04dd9b1680ae | 49 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 50 | #include "stm32f4xx_ll_usb.h" |
bogdanm | 86:04dd9b1680ae | 51 | |
bogdanm | 86:04dd9b1680ae | 52 | /** @addtogroup STM32F4xx_HAL_Driver |
bogdanm | 86:04dd9b1680ae | 53 | * @{ |
bogdanm | 86:04dd9b1680ae | 54 | */ |
bogdanm | 86:04dd9b1680ae | 55 | |
bogdanm | 86:04dd9b1680ae | 56 | /** @addtogroup PCD |
bogdanm | 86:04dd9b1680ae | 57 | * @{ |
bogdanm | 86:04dd9b1680ae | 58 | */ |
bogdanm | 86:04dd9b1680ae | 59 | |
bogdanm | 86:04dd9b1680ae | 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 | */ |
bogdanm | 86:04dd9b1680ae | 68 | typedef enum |
bogdanm | 86:04dd9b1680ae | 69 | { |
bogdanm | 86:04dd9b1680ae | 70 | HAL_PCD_STATE_RESET = 0x00, |
bogdanm | 86:04dd9b1680ae | 71 | HAL_PCD_STATE_READY = 0x01, |
bogdanm | 86:04dd9b1680ae | 72 | HAL_PCD_STATE_ERROR = 0x02, |
bogdanm | 86:04dd9b1680ae | 73 | HAL_PCD_STATE_BUSY = 0x03, |
bogdanm | 86:04dd9b1680ae | 74 | HAL_PCD_STATE_TIMEOUT = 0x04 |
bogdanm | 86:04dd9b1680ae | 75 | } PCD_StateTypeDef; |
bogdanm | 86:04dd9b1680ae | 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 */ |
bogdanm | 86:04dd9b1680ae | 87 | |
bogdanm | 86:04dd9b1680ae | 88 | typedef USB_OTG_GlobalTypeDef PCD_TypeDef; |
bogdanm | 86:04dd9b1680ae | 89 | typedef USB_OTG_CfgTypeDef PCD_InitTypeDef; |
bogdanm | 86:04dd9b1680ae | 90 | typedef USB_OTG_EPTypeDef PCD_EPTypeDef ; |
bogdanm | 86:04dd9b1680ae | 91 | |
bogdanm | 86:04dd9b1680ae | 92 | /** |
bogdanm | 86:04dd9b1680ae | 93 | * @brief PCD Handle Structure definition |
bogdanm | 86:04dd9b1680ae | 94 | */ |
bogdanm | 86:04dd9b1680ae | 95 | typedef struct |
bogdanm | 86:04dd9b1680ae | 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 */ |
bogdanm | 86:04dd9b1680ae | 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 | |
bogdanm | 86:04dd9b1680ae | 124 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 125 | /** @defgroup PCD_Exported_Constants PCD Exported Constants |
bogdanm | 86:04dd9b1680ae | 126 | * @{ |
bogdanm | 86:04dd9b1680ae | 127 | */ |
bogdanm | 86:04dd9b1680ae | 128 | |
Kojto | 99:dbbf35b96557 | 129 | /** @defgroup PCD_Speed PCD Speed |
bogdanm | 86:04dd9b1680ae | 130 | * @{ |
bogdanm | 86:04dd9b1680ae | 131 | */ |
bogdanm | 86:04dd9b1680ae | 132 | #define PCD_SPEED_HIGH 0 |
bogdanm | 86:04dd9b1680ae | 133 | #define PCD_SPEED_HIGH_IN_FULL 1 |
bogdanm | 86:04dd9b1680ae | 134 | #define PCD_SPEED_FULL 2 |
bogdanm | 86:04dd9b1680ae | 135 | /** |
bogdanm | 86:04dd9b1680ae | 136 | * @} |
bogdanm | 86:04dd9b1680ae | 137 | */ |
bogdanm | 86:04dd9b1680ae | 138 | |
Kojto | 99:dbbf35b96557 | 139 | /** @defgroup PCD_PHY_Module PCD PHY Module |
bogdanm | 86:04dd9b1680ae | 140 | * @{ |
bogdanm | 86:04dd9b1680ae | 141 | */ |
bogdanm | 86:04dd9b1680ae | 142 | #define PCD_PHY_ULPI 1 |
bogdanm | 86:04dd9b1680ae | 143 | #define PCD_PHY_EMBEDDED 2 |
bogdanm | 86:04dd9b1680ae | 144 | /** |
bogdanm | 86:04dd9b1680ae | 145 | * @} |
bogdanm | 86:04dd9b1680ae | 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 | |
bogdanm | 86:04dd9b1680ae | 161 | /** |
bogdanm | 86:04dd9b1680ae | 162 | * @} |
bogdanm | 86:04dd9b1680ae | 163 | */ |
bogdanm | 86:04dd9b1680ae | 164 | |
Kojto | 99:dbbf35b96557 | 165 | /* Exported macros -----------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 166 | /** @defgroup PCD_Exported_Macros PCD Exported Macros |
bogdanm | 86:04dd9b1680ae | 167 | * @brief macros to handle interrupts and specific clock configurations |
bogdanm | 86:04dd9b1680ae | 168 | * @{ |
bogdanm | 86:04dd9b1680ae | 169 | */ |
bogdanm | 86:04dd9b1680ae | 170 | #define __HAL_PCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance) |
bogdanm | 86:04dd9b1680ae | 171 | #define __HAL_PCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance) |
bogdanm | 86:04dd9b1680ae | 172 | |
bogdanm | 86:04dd9b1680ae | 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__)) |
bogdanm | 86:04dd9b1680ae | 175 | #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0) |
bogdanm | 86:04dd9b1680ae | 176 | |
bogdanm | 86:04dd9b1680ae | 177 | |
bogdanm | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 180 | |
bogdanm | 86:04dd9b1680ae | 181 | #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK |
bogdanm | 86:04dd9b1680ae | 182 | |
bogdanm | 86:04dd9b1680ae | 183 | #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE))&0x10) |
bogdanm | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 221 | |
bogdanm | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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 | 86:04dd9b1680ae | 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); |
bogdanm | 86:04dd9b1680ae | 249 | /** |
bogdanm | 86:04dd9b1680ae | 250 | * @} |
bogdanm | 86:04dd9b1680ae | 251 | */ |
bogdanm | 86:04dd9b1680ae | 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 */ |
bogdanm | 86:04dd9b1680ae | 259 | HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 260 | HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 261 | void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 262 | |
bogdanm | 86:04dd9b1680ae | 263 | void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 264 | void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 265 | void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 266 | void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 267 | void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 268 | void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 269 | void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 270 | void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 271 | void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 272 | void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 273 | void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 274 | /** |
Kojto | 99:dbbf35b96557 | 275 | * @} |
Kojto | 99:dbbf35b96557 | 276 | */ |
bogdanm | 86:04dd9b1680ae | 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 | */ |
bogdanm | 86:04dd9b1680ae | 282 | HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 283 | HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 284 | HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address); |
bogdanm | 86:04dd9b1680ae | 285 | HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type); |
bogdanm | 86:04dd9b1680ae | 286 | HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 287 | HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len); |
bogdanm | 86:04dd9b1680ae | 288 | HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len); |
bogdanm | 86:04dd9b1680ae | 289 | uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 290 | HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 291 | HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 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 | */ |
bogdanm | 86:04dd9b1680ae | 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 | */ |
bogdanm | 86:04dd9b1680ae | 329 | |
bogdanm | 86:04dd9b1680ae | 330 | /** |
bogdanm | 86:04dd9b1680ae | 331 | * @} |
bogdanm | 86:04dd9b1680ae | 332 | */ |
bogdanm | 86:04dd9b1680ae | 333 | |
bogdanm | 86:04dd9b1680ae | 334 | /** |
bogdanm | 86:04dd9b1680ae | 335 | * @} |
bogdanm | 86:04dd9b1680ae | 336 | */ |
bogdanm | 86:04dd9b1680ae | 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 */ |
bogdanm | 86:04dd9b1680ae | 343 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 344 | } |
bogdanm | 86:04dd9b1680ae | 345 | #endif |
bogdanm | 86:04dd9b1680ae | 346 | |
bogdanm | 86:04dd9b1680ae | 347 | |
bogdanm | 86:04dd9b1680ae | 348 | #endif /* __STM32F4xx_HAL_PCD_H */ |
bogdanm | 86:04dd9b1680ae | 349 | |
bogdanm | 86:04dd9b1680ae | 350 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |