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@106:ba1f97679dad, 2015-09-02 (annotated)
- Committer:
- Kojto
- Date:
- Wed Sep 02 14:17:43 2015 +0100
- Revision:
- 106:ba1f97679dad
- Parent:
- 99:dbbf35b96557
- Child:
- 110:165afa46840b
Release 106 of the mbed library
Changes:
- new platform - Nucleo F446RE
- STM32F4 Cube driver update v2.3.2
- ST cmsis driver v2.3.2
- nordic bugfix gcc linker start address
- lpc11u68 - bugfix for serial ports
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 | 106:ba1f97679dad | 5 | * @version V1.3.2 |
Kojto | 106:ba1f97679dad | 6 | * @date 26-June-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 |
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 ------------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 58 | /** @defgroup PCD_Exported_Types PCD Exported Types |
Kojto | 99:dbbf35b96557 | 59 | * @{ |
Kojto | 99:dbbf35b96557 | 60 | */ |
Kojto | 99:dbbf35b96557 | 61 | |
Kojto | 99:dbbf35b96557 | 62 | /** |
Kojto | 99:dbbf35b96557 | 63 | * @brief PCD State structure definition |
Kojto | 99:dbbf35b96557 | 64 | */ |
bogdanm | 86:04dd9b1680ae | 65 | typedef enum |
bogdanm | 86:04dd9b1680ae | 66 | { |
bogdanm | 86:04dd9b1680ae | 67 | HAL_PCD_STATE_RESET = 0x00, |
bogdanm | 86:04dd9b1680ae | 68 | HAL_PCD_STATE_READY = 0x01, |
bogdanm | 86:04dd9b1680ae | 69 | HAL_PCD_STATE_ERROR = 0x02, |
bogdanm | 86:04dd9b1680ae | 70 | HAL_PCD_STATE_BUSY = 0x03, |
bogdanm | 86:04dd9b1680ae | 71 | HAL_PCD_STATE_TIMEOUT = 0x04 |
bogdanm | 86:04dd9b1680ae | 72 | } PCD_StateTypeDef; |
bogdanm | 86:04dd9b1680ae | 73 | |
Kojto | 99:dbbf35b96557 | 74 | #ifdef USB_OTG_GLPMCFG_LPMEN |
Kojto | 99:dbbf35b96557 | 75 | /* Device LPM suspend state */ |
Kojto | 99:dbbf35b96557 | 76 | typedef enum |
Kojto | 99:dbbf35b96557 | 77 | { |
Kojto | 99:dbbf35b96557 | 78 | LPM_L0 = 0x00, /* on */ |
Kojto | 99:dbbf35b96557 | 79 | LPM_L1 = 0x01, /* LPM L1 sleep */ |
Kojto | 99:dbbf35b96557 | 80 | LPM_L2 = 0x02, /* suspend */ |
Kojto | 99:dbbf35b96557 | 81 | LPM_L3 = 0x03, /* off */ |
Kojto | 99:dbbf35b96557 | 82 | }PCD_LPM_StateTypeDef; |
Kojto | 99:dbbf35b96557 | 83 | #endif /* USB_OTG_GLPMCFG_LPMEN */ |
bogdanm | 86:04dd9b1680ae | 84 | |
bogdanm | 86:04dd9b1680ae | 85 | typedef USB_OTG_GlobalTypeDef PCD_TypeDef; |
bogdanm | 86:04dd9b1680ae | 86 | typedef USB_OTG_CfgTypeDef PCD_InitTypeDef; |
bogdanm | 86:04dd9b1680ae | 87 | typedef USB_OTG_EPTypeDef PCD_EPTypeDef ; |
bogdanm | 86:04dd9b1680ae | 88 | |
bogdanm | 86:04dd9b1680ae | 89 | /** |
bogdanm | 86:04dd9b1680ae | 90 | * @brief PCD Handle Structure definition |
bogdanm | 86:04dd9b1680ae | 91 | */ |
bogdanm | 86:04dd9b1680ae | 92 | typedef struct |
bogdanm | 86:04dd9b1680ae | 93 | { |
Kojto | 99:dbbf35b96557 | 94 | PCD_TypeDef *Instance; /*!< Register base address */ |
Kojto | 99:dbbf35b96557 | 95 | PCD_InitTypeDef Init; /*!< PCD required parameters */ |
Kojto | 99:dbbf35b96557 | 96 | PCD_EPTypeDef IN_ep[15]; /*!< IN endpoint parameters */ |
Kojto | 99:dbbf35b96557 | 97 | PCD_EPTypeDef OUT_ep[15]; /*!< OUT endpoint parameters */ |
Kojto | 99:dbbf35b96557 | 98 | HAL_LockTypeDef Lock; /*!< PCD peripheral status */ |
Kojto | 99:dbbf35b96557 | 99 | __IO PCD_StateTypeDef State; /*!< PCD communication state */ |
Kojto | 99:dbbf35b96557 | 100 | uint32_t Setup[12]; /*!< Setup packet buffer */ |
Kojto | 99:dbbf35b96557 | 101 | #ifdef USB_OTG_GLPMCFG_LPMEN |
Kojto | 99:dbbf35b96557 | 102 | PCD_LPM_StateTypeDef LPM_State; /*!< LPM State */ |
Kojto | 99:dbbf35b96557 | 103 | uint32_t BESL; |
Kojto | 99:dbbf35b96557 | 104 | uint32_t lpm_active; /*!< Enable or disable the Link Power Management . |
Kojto | 99:dbbf35b96557 | 105 | This parameter can be set to ENABLE or DISABLE */ |
Kojto | 99:dbbf35b96557 | 106 | #endif /* USB_OTG_GLPMCFG_LPMEN */ |
Kojto | 99:dbbf35b96557 | 107 | void *pData; /*!< Pointer to upper stack Handler */ |
bogdanm | 86:04dd9b1680ae | 108 | } PCD_HandleTypeDef; |
Kojto | 99:dbbf35b96557 | 109 | |
Kojto | 99:dbbf35b96557 | 110 | /** |
Kojto | 99:dbbf35b96557 | 111 | * @} |
Kojto | 99:dbbf35b96557 | 112 | */ |
Kojto | 99:dbbf35b96557 | 113 | |
Kojto | 99:dbbf35b96557 | 114 | /* Include PCD HAL Extension module */ |
Kojto | 99:dbbf35b96557 | 115 | #include "stm32f4xx_hal_pcd_ex.h" |
Kojto | 99:dbbf35b96557 | 116 | |
bogdanm | 86:04dd9b1680ae | 117 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 118 | /** @defgroup PCD_Exported_Constants PCD Exported Constants |
bogdanm | 86:04dd9b1680ae | 119 | * @{ |
bogdanm | 86:04dd9b1680ae | 120 | */ |
bogdanm | 86:04dd9b1680ae | 121 | |
Kojto | 99:dbbf35b96557 | 122 | /** @defgroup PCD_Speed PCD Speed |
bogdanm | 86:04dd9b1680ae | 123 | * @{ |
bogdanm | 86:04dd9b1680ae | 124 | */ |
bogdanm | 86:04dd9b1680ae | 125 | #define PCD_SPEED_HIGH 0 |
bogdanm | 86:04dd9b1680ae | 126 | #define PCD_SPEED_HIGH_IN_FULL 1 |
bogdanm | 86:04dd9b1680ae | 127 | #define PCD_SPEED_FULL 2 |
bogdanm | 86:04dd9b1680ae | 128 | /** |
bogdanm | 86:04dd9b1680ae | 129 | * @} |
bogdanm | 86:04dd9b1680ae | 130 | */ |
bogdanm | 86:04dd9b1680ae | 131 | |
Kojto | 99:dbbf35b96557 | 132 | /** @defgroup PCD_PHY_Module PCD PHY Module |
bogdanm | 86:04dd9b1680ae | 133 | * @{ |
bogdanm | 86:04dd9b1680ae | 134 | */ |
bogdanm | 86:04dd9b1680ae | 135 | #define PCD_PHY_ULPI 1 |
bogdanm | 86:04dd9b1680ae | 136 | #define PCD_PHY_EMBEDDED 2 |
bogdanm | 86:04dd9b1680ae | 137 | /** |
bogdanm | 86:04dd9b1680ae | 138 | * @} |
bogdanm | 86:04dd9b1680ae | 139 | */ |
bogdanm | 86:04dd9b1680ae | 140 | |
Kojto | 106:ba1f97679dad | 141 | /** @defgroup PCD_Turnaround_Timeout Turnaround Timeout Value |
Kojto | 106:ba1f97679dad | 142 | * @{ |
Kojto | 106:ba1f97679dad | 143 | */ |
Kojto | 106:ba1f97679dad | 144 | #ifndef USBD_HS_TRDT_VALUE |
Kojto | 106:ba1f97679dad | 145 | #define USBD_HS_TRDT_VALUE 9 |
Kojto | 106:ba1f97679dad | 146 | #endif /* USBD_HS_TRDT_VALUE */ |
Kojto | 106:ba1f97679dad | 147 | #ifndef USBD_FS_TRDT_VALUE |
Kojto | 106:ba1f97679dad | 148 | #define USBD_FS_TRDT_VALUE 5 |
Kojto | 106:ba1f97679dad | 149 | #endif /* USBD_FS_TRDT_VALUE */ |
Kojto | 106:ba1f97679dad | 150 | /** |
Kojto | 106:ba1f97679dad | 151 | * @} |
Kojto | 106:ba1f97679dad | 152 | */ |
Kojto | 106:ba1f97679dad | 153 | |
bogdanm | 86:04dd9b1680ae | 154 | /** |
bogdanm | 86:04dd9b1680ae | 155 | * @} |
bogdanm | 86:04dd9b1680ae | 156 | */ |
bogdanm | 86:04dd9b1680ae | 157 | |
Kojto | 99:dbbf35b96557 | 158 | /* Exported macros -----------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 159 | /** @defgroup PCD_Exported_Macros PCD Exported Macros |
bogdanm | 86:04dd9b1680ae | 160 | * @brief macros to handle interrupts and specific clock configurations |
bogdanm | 86:04dd9b1680ae | 161 | * @{ |
bogdanm | 86:04dd9b1680ae | 162 | */ |
bogdanm | 86:04dd9b1680ae | 163 | #define __HAL_PCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance) |
bogdanm | 86:04dd9b1680ae | 164 | #define __HAL_PCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance) |
bogdanm | 86:04dd9b1680ae | 165 | |
bogdanm | 86:04dd9b1680ae | 166 | #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__)) |
bogdanm | 86:04dd9b1680ae | 167 | #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__)) |
bogdanm | 86:04dd9b1680ae | 168 | #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0) |
bogdanm | 86:04dd9b1680ae | 169 | |
bogdanm | 86:04dd9b1680ae | 170 | |
bogdanm | 86:04dd9b1680ae | 171 | #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= \ |
Kojto | 99:dbbf35b96557 | 172 | ~(USB_OTG_PCGCCTL_STOPCLK) |
bogdanm | 86:04dd9b1680ae | 173 | |
bogdanm | 86:04dd9b1680ae | 174 | #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK |
bogdanm | 86:04dd9b1680ae | 175 | |
bogdanm | 86:04dd9b1680ae | 176 | #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE))&0x10) |
bogdanm | 86:04dd9b1680ae | 177 | |
Kojto | 99:dbbf35b96557 | 178 | #define USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08) |
Kojto | 99:dbbf35b96557 | 179 | #define USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C) |
Kojto | 99:dbbf35b96557 | 180 | #define USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10) |
Kojto | 99:dbbf35b96557 | 181 | |
Kojto | 99:dbbf35b96557 | 182 | #define USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08) |
Kojto | 99:dbbf35b96557 | 183 | #define USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C) |
Kojto | 99:dbbf35b96557 | 184 | #define USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10) |
bogdanm | 86:04dd9b1680ae | 185 | |
Kojto | 99:dbbf35b96557 | 186 | #define USB_OTG_HS_WAKEUP_EXTI_LINE ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the USB HS EXTI Line */ |
Kojto | 99:dbbf35b96557 | 187 | #define USB_OTG_FS_WAKEUP_EXTI_LINE ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */ |
bogdanm | 86:04dd9b1680ae | 188 | |
Kojto | 99:dbbf35b96557 | 189 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (USB_OTG_HS_WAKEUP_EXTI_LINE) |
Kojto | 99:dbbf35b96557 | 190 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE) |
Kojto | 99:dbbf35b96557 | 191 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_HS_WAKEUP_EXTI_LINE) |
Kojto | 99:dbbf35b96557 | 192 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (USB_OTG_HS_WAKEUP_EXTI_LINE) |
bogdanm | 86:04dd9b1680ae | 193 | |
Kojto | 99:dbbf35b96557 | 194 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\ |
Kojto | 99:dbbf35b96557 | 195 | EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE |
Kojto | 99:dbbf35b96557 | 196 | |
Kojto | 99:dbbf35b96557 | 197 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_HS_WAKEUP_EXTI_LINE);\ |
Kojto | 99:dbbf35b96557 | 198 | EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE) |
bogdanm | 86:04dd9b1680ae | 199 | |
Kojto | 99:dbbf35b96557 | 200 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\ |
Kojto | 99:dbbf35b96557 | 201 | EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE;)\ |
Kojto | 99:dbbf35b96557 | 202 | EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE;\ |
Kojto | 99:dbbf35b96557 | 203 | EXTI->FTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE |
bogdanm | 86:04dd9b1680ae | 204 | |
Kojto | 99:dbbf35b96557 | 205 | #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE) |
Kojto | 99:dbbf35b96557 | 206 | |
Kojto | 99:dbbf35b96557 | 207 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= USB_OTG_FS_WAKEUP_EXTI_LINE |
Kojto | 99:dbbf35b96557 | 208 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE) |
Kojto | 99:dbbf35b96557 | 209 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_FS_WAKEUP_EXTI_LINE) |
Kojto | 99:dbbf35b96557 | 210 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = USB_OTG_FS_WAKEUP_EXTI_LINE |
Kojto | 99:dbbf35b96557 | 211 | |
Kojto | 99:dbbf35b96557 | 212 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\ |
Kojto | 99:dbbf35b96557 | 213 | EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE |
bogdanm | 86:04dd9b1680ae | 214 | |
bogdanm | 86:04dd9b1680ae | 215 | |
Kojto | 99:dbbf35b96557 | 216 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_FS_WAKEUP_EXTI_LINE);\ |
Kojto | 99:dbbf35b96557 | 217 | EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE) |
bogdanm | 86:04dd9b1680ae | 218 | |
Kojto | 99:dbbf35b96557 | 219 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\ |
Kojto | 99:dbbf35b96557 | 220 | EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\ |
Kojto | 99:dbbf35b96557 | 221 | EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE;\ |
Kojto | 99:dbbf35b96557 | 222 | EXTI->FTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE |
Kojto | 99:dbbf35b96557 | 223 | |
Kojto | 99:dbbf35b96557 | 224 | #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE) |
Kojto | 106:ba1f97679dad | 225 | /** |
Kojto | 106:ba1f97679dad | 226 | * @} |
Kojto | 106:ba1f97679dad | 227 | */ |
bogdanm | 86:04dd9b1680ae | 228 | |
Kojto | 99:dbbf35b96557 | 229 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 230 | /** @addtogroup PCD_Exported_Functions PCD Exported Functions |
Kojto | 99:dbbf35b96557 | 231 | * @{ |
Kojto | 99:dbbf35b96557 | 232 | */ |
bogdanm | 86:04dd9b1680ae | 233 | |
Kojto | 99:dbbf35b96557 | 234 | /* Initialization/de-initialization functions ********************************/ |
Kojto | 99:dbbf35b96557 | 235 | /** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions |
Kojto | 99:dbbf35b96557 | 236 | * @{ |
Kojto | 99:dbbf35b96557 | 237 | */ |
Kojto | 99:dbbf35b96557 | 238 | HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 239 | HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 240 | void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 241 | void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 242 | /** |
bogdanm | 86:04dd9b1680ae | 243 | * @} |
bogdanm | 86:04dd9b1680ae | 244 | */ |
bogdanm | 86:04dd9b1680ae | 245 | |
Kojto | 99:dbbf35b96557 | 246 | /* I/O operation functions ***************************************************/ |
Kojto | 99:dbbf35b96557 | 247 | /* Non-Blocking mode: Interrupt */ |
Kojto | 99:dbbf35b96557 | 248 | /** @addtogroup PCD_Exported_Functions_Group2 IO operation functions |
Kojto | 99:dbbf35b96557 | 249 | * @{ |
Kojto | 99:dbbf35b96557 | 250 | */ |
Kojto | 99:dbbf35b96557 | 251 | /* Non-Blocking mode: Interrupt */ |
bogdanm | 86:04dd9b1680ae | 252 | HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 253 | HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 254 | void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 255 | |
bogdanm | 86:04dd9b1680ae | 256 | void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 257 | void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 258 | void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 259 | void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 260 | void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 261 | void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 262 | void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 263 | void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 264 | void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum); |
bogdanm | 86:04dd9b1680ae | 265 | void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 266 | void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 267 | /** |
Kojto | 99:dbbf35b96557 | 268 | * @} |
Kojto | 99:dbbf35b96557 | 269 | */ |
bogdanm | 86:04dd9b1680ae | 270 | |
Kojto | 99:dbbf35b96557 | 271 | /* Peripheral Control functions **********************************************/ |
Kojto | 99:dbbf35b96557 | 272 | /** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions |
Kojto | 99:dbbf35b96557 | 273 | * @{ |
Kojto | 99:dbbf35b96557 | 274 | */ |
bogdanm | 86:04dd9b1680ae | 275 | HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 276 | HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd); |
bogdanm | 86:04dd9b1680ae | 277 | HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address); |
bogdanm | 86:04dd9b1680ae | 278 | HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type); |
bogdanm | 86:04dd9b1680ae | 279 | HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 280 | HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len); |
bogdanm | 86:04dd9b1680ae | 281 | HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len); |
bogdanm | 86:04dd9b1680ae | 282 | uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 283 | HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 284 | HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
bogdanm | 86:04dd9b1680ae | 285 | HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr); |
Kojto | 99:dbbf35b96557 | 286 | HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 287 | HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 288 | /** |
Kojto | 99:dbbf35b96557 | 289 | * @} |
Kojto | 99:dbbf35b96557 | 290 | */ |
Kojto | 99:dbbf35b96557 | 291 | |
Kojto | 99:dbbf35b96557 | 292 | /* Peripheral State functions ************************************************/ |
Kojto | 99:dbbf35b96557 | 293 | /** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions |
Kojto | 99:dbbf35b96557 | 294 | * @{ |
Kojto | 99:dbbf35b96557 | 295 | */ |
Kojto | 99:dbbf35b96557 | 296 | PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd); |
Kojto | 99:dbbf35b96557 | 297 | /** |
Kojto | 99:dbbf35b96557 | 298 | * @} |
Kojto | 99:dbbf35b96557 | 299 | */ |
bogdanm | 86:04dd9b1680ae | 300 | |
Kojto | 99:dbbf35b96557 | 301 | /** |
Kojto | 99:dbbf35b96557 | 302 | * @} |
Kojto | 106:ba1f97679dad | 303 | */ |
Kojto | 106:ba1f97679dad | 304 | |
Kojto | 106:ba1f97679dad | 305 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 106:ba1f97679dad | 306 | /** @defgroup PCD_Private_Macros PCD Private Macros |
Kojto | 106:ba1f97679dad | 307 | * @{ |
Kojto | 106:ba1f97679dad | 308 | */ |
Kojto | 99:dbbf35b96557 | 309 | /** @defgroup PCD_Instance_definition PCD Instance definition |
Kojto | 99:dbbf35b96557 | 310 | * @{ |
Kojto | 99:dbbf35b96557 | 311 | */ |
Kojto | 99:dbbf35b96557 | 312 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) ||\ |
Kojto | 99:dbbf35b96557 | 313 | defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F446xx) |
Kojto | 99:dbbf35b96557 | 314 | #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \ |
Kojto | 99:dbbf35b96557 | 315 | ((INSTANCE) == USB_OTG_HS)) |
Kojto | 99:dbbf35b96557 | 316 | #elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) |
Kojto | 99:dbbf35b96557 | 317 | #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS)) |
Kojto | 99:dbbf35b96557 | 318 | #endif |
Kojto | 99:dbbf35b96557 | 319 | /** |
Kojto | 99:dbbf35b96557 | 320 | * @} |
Kojto | 99:dbbf35b96557 | 321 | */ |
Kojto | 99:dbbf35b96557 | 322 | /** |
Kojto | 99:dbbf35b96557 | 323 | * @} |
Kojto | 106:ba1f97679dad | 324 | */ |
bogdanm | 86:04dd9b1680ae | 325 | |
bogdanm | 86:04dd9b1680ae | 326 | /** |
bogdanm | 86:04dd9b1680ae | 327 | * @} |
bogdanm | 86:04dd9b1680ae | 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 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 335 | } |
bogdanm | 86:04dd9b1680ae | 336 | #endif |
bogdanm | 86:04dd9b1680ae | 337 | |
bogdanm | 86:04dd9b1680ae | 338 | |
bogdanm | 86:04dd9b1680ae | 339 | #endif /* __STM32F4xx_HAL_PCD_H */ |
bogdanm | 86:04dd9b1680ae | 340 | |
bogdanm | 86:04dd9b1680ae | 341 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |