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:
Kojto
Date:
Wed May 27 08:07:35 2015 +0100
Revision:
100:cbbeb26dbd92
Release 100 of the mbed library

Changes:
- new target: DISCOF334C8
- API: Ticker/Timer bugfix with constness
- Silabs: RTC, PWM, Serial clocks bufixes
- Renesas: i2c bugfix
- Maxim: 326000 - pin definitions for v2, spi freq fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 100:cbbeb26dbd92 1 /**
Kojto 100:cbbeb26dbd92 2 ******************************************************************************
Kojto 100:cbbeb26dbd92 3 * @file stm32f3xx_hal_pcd.h
Kojto 100:cbbeb26dbd92 4 * @author MCD Application Team
Kojto 100:cbbeb26dbd92 5 * @version V1.1.0
Kojto 100:cbbeb26dbd92 6 * @date 12-Sept-2014
Kojto 100:cbbeb26dbd92 7 * @brief Header file of PCD HAL module.
Kojto 100:cbbeb26dbd92 8 ******************************************************************************
Kojto 100:cbbeb26dbd92 9 * @attention
Kojto 100:cbbeb26dbd92 10 *
Kojto 100:cbbeb26dbd92 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 100:cbbeb26dbd92 12 *
Kojto 100:cbbeb26dbd92 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 100:cbbeb26dbd92 14 * are permitted provided that the following conditions are met:
Kojto 100:cbbeb26dbd92 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 100:cbbeb26dbd92 16 * this list of conditions and the following disclaimer.
Kojto 100:cbbeb26dbd92 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 100:cbbeb26dbd92 18 * this list of conditions and the following disclaimer in the documentation
Kojto 100:cbbeb26dbd92 19 * and/or other materials provided with the distribution.
Kojto 100:cbbeb26dbd92 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 100:cbbeb26dbd92 21 * may be used to endorse or promote products derived from this software
Kojto 100:cbbeb26dbd92 22 * without specific prior written permission.
Kojto 100:cbbeb26dbd92 23 *
Kojto 100:cbbeb26dbd92 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 100:cbbeb26dbd92 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 100:cbbeb26dbd92 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 100:cbbeb26dbd92 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 100:cbbeb26dbd92 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 100:cbbeb26dbd92 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 100:cbbeb26dbd92 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 100:cbbeb26dbd92 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 100:cbbeb26dbd92 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 100:cbbeb26dbd92 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 100:cbbeb26dbd92 34 *
Kojto 100:cbbeb26dbd92 35 ******************************************************************************
Kojto 100:cbbeb26dbd92 36 */
Kojto 100:cbbeb26dbd92 37
Kojto 100:cbbeb26dbd92 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 100:cbbeb26dbd92 39 #ifndef __STM32F3xx_HAL_PCD_H
Kojto 100:cbbeb26dbd92 40 #define __STM32F3xx_HAL_PCD_H
Kojto 100:cbbeb26dbd92 41
Kojto 100:cbbeb26dbd92 42 #ifdef __cplusplus
Kojto 100:cbbeb26dbd92 43 extern "C" {
Kojto 100:cbbeb26dbd92 44 #endif
Kojto 100:cbbeb26dbd92 45
Kojto 100:cbbeb26dbd92 46 #if defined(STM32F302xE) || defined(STM32F303xE) || \
Kojto 100:cbbeb26dbd92 47 defined(STM32F302xC) || defined(STM32F303xC) || \
Kojto 100:cbbeb26dbd92 48 defined(STM32F302x8) || \
Kojto 100:cbbeb26dbd92 49 defined(STM32F373xC)
Kojto 100:cbbeb26dbd92 50
Kojto 100:cbbeb26dbd92 51 /* Includes ------------------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 52 #include "stm32f3xx_hal_def.h"
Kojto 100:cbbeb26dbd92 53
Kojto 100:cbbeb26dbd92 54 /** @addtogroup STM32F3xx_HAL_Driver
Kojto 100:cbbeb26dbd92 55 * @{
Kojto 100:cbbeb26dbd92 56 */
Kojto 100:cbbeb26dbd92 57
Kojto 100:cbbeb26dbd92 58 /** @addtogroup PCD
Kojto 100:cbbeb26dbd92 59 * @{
Kojto 100:cbbeb26dbd92 60 */
Kojto 100:cbbeb26dbd92 61
Kojto 100:cbbeb26dbd92 62 /* Exported types ------------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 63 /** @defgroup PCD_Exported_Types PCD Exported Types
Kojto 100:cbbeb26dbd92 64 * @{
Kojto 100:cbbeb26dbd92 65 */
Kojto 100:cbbeb26dbd92 66
Kojto 100:cbbeb26dbd92 67 /**
Kojto 100:cbbeb26dbd92 68 * @brief PCD State structures definition
Kojto 100:cbbeb26dbd92 69 */
Kojto 100:cbbeb26dbd92 70 typedef enum
Kojto 100:cbbeb26dbd92 71 {
Kojto 100:cbbeb26dbd92 72 PCD_READY = 0x00,
Kojto 100:cbbeb26dbd92 73 PCD_ERROR = 0x01,
Kojto 100:cbbeb26dbd92 74 PCD_BUSY = 0x02,
Kojto 100:cbbeb26dbd92 75 PCD_TIMEOUT = 0x03
Kojto 100:cbbeb26dbd92 76 } PCD_StateTypeDef;
Kojto 100:cbbeb26dbd92 77
Kojto 100:cbbeb26dbd92 78 typedef enum
Kojto 100:cbbeb26dbd92 79 {
Kojto 100:cbbeb26dbd92 80 /* double buffered endpoint direction */
Kojto 100:cbbeb26dbd92 81 PCD_EP_DBUF_OUT,
Kojto 100:cbbeb26dbd92 82 PCD_EP_DBUF_IN,
Kojto 100:cbbeb26dbd92 83 PCD_EP_DBUF_ERR,
Kojto 100:cbbeb26dbd92 84 }PCD_EP_DBUF_DIR;
Kojto 100:cbbeb26dbd92 85
Kojto 100:cbbeb26dbd92 86 /* endpoint buffer number */
Kojto 100:cbbeb26dbd92 87 typedef enum
Kojto 100:cbbeb26dbd92 88 {
Kojto 100:cbbeb26dbd92 89 PCD_EP_NOBUF,
Kojto 100:cbbeb26dbd92 90 PCD_EP_BUF0,
Kojto 100:cbbeb26dbd92 91 PCD_EP_BUF1
Kojto 100:cbbeb26dbd92 92 }PCD_EP_BUF_NUM;
Kojto 100:cbbeb26dbd92 93
Kojto 100:cbbeb26dbd92 94 /**
Kojto 100:cbbeb26dbd92 95 * @brief PCD Initialization Structure definition
Kojto 100:cbbeb26dbd92 96 */
Kojto 100:cbbeb26dbd92 97 typedef struct
Kojto 100:cbbeb26dbd92 98 {
Kojto 100:cbbeb26dbd92 99 uint32_t dev_endpoints; /*!< Device Endpoints number.
Kojto 100:cbbeb26dbd92 100 This parameter depends on the used USB core.
Kojto 100:cbbeb26dbd92 101 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 100:cbbeb26dbd92 102
Kojto 100:cbbeb26dbd92 103 uint32_t speed; /*!< USB Core speed.
Kojto 100:cbbeb26dbd92 104 This parameter can be any value of @ref USB_Core_Speed */
Kojto 100:cbbeb26dbd92 105
Kojto 100:cbbeb26dbd92 106 uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size.
Kojto 100:cbbeb26dbd92 107 This parameter can be any value of @ref USB_EP0_MPS */
Kojto 100:cbbeb26dbd92 108
Kojto 100:cbbeb26dbd92 109 uint32_t phy_itface; /*!< Select the used PHY interface.
Kojto 100:cbbeb26dbd92 110 This parameter can be any value of @ref USB_Core_PHY */
Kojto 100:cbbeb26dbd92 111
Kojto 100:cbbeb26dbd92 112 uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
Kojto 100:cbbeb26dbd92 113
Kojto 100:cbbeb26dbd92 114 uint32_t low_power_enable; /*!< Enable or disable Low Power mode */
Kojto 100:cbbeb26dbd92 115
Kojto 100:cbbeb26dbd92 116 uint32_t lpm_enable; /*!< Enable or disable Battery charging. */
Kojto 100:cbbeb26dbd92 117
Kojto 100:cbbeb26dbd92 118 uint32_t battery_charging_enable; /*!< Enable or disable Battery charging. */
Kojto 100:cbbeb26dbd92 119
Kojto 100:cbbeb26dbd92 120 }PCD_InitTypeDef;
Kojto 100:cbbeb26dbd92 121
Kojto 100:cbbeb26dbd92 122 typedef struct
Kojto 100:cbbeb26dbd92 123 {
Kojto 100:cbbeb26dbd92 124 uint8_t num; /*!< Endpoint number
Kojto 100:cbbeb26dbd92 125 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 100:cbbeb26dbd92 126
Kojto 100:cbbeb26dbd92 127 uint8_t is_in; /*!< Endpoint direction
Kojto 100:cbbeb26dbd92 128 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 100:cbbeb26dbd92 129
Kojto 100:cbbeb26dbd92 130 uint8_t is_stall; /*!< Endpoint stall condition
Kojto 100:cbbeb26dbd92 131 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 100:cbbeb26dbd92 132
Kojto 100:cbbeb26dbd92 133 uint8_t type; /*!< Endpoint type
Kojto 100:cbbeb26dbd92 134 This parameter can be any value of @ref USB_EP_Type */
Kojto 100:cbbeb26dbd92 135
Kojto 100:cbbeb26dbd92 136 uint16_t pmaadress; /*!< PMA Address
Kojto 100:cbbeb26dbd92 137 This parameter can be any value between Min_addr = 0 and Max_addr = 1K */
Kojto 100:cbbeb26dbd92 138
Kojto 100:cbbeb26dbd92 139
Kojto 100:cbbeb26dbd92 140 uint16_t pmaaddr0; /*!< PMA Address0
Kojto 100:cbbeb26dbd92 141 This parameter can be any value between Min_addr = 0 and Max_addr = 1K */
Kojto 100:cbbeb26dbd92 142
Kojto 100:cbbeb26dbd92 143
Kojto 100:cbbeb26dbd92 144 uint16_t pmaaddr1; /*!< PMA Address1
Kojto 100:cbbeb26dbd92 145 This parameter can be any value between Min_addr = 0 and Max_addr = 1K */
Kojto 100:cbbeb26dbd92 146
Kojto 100:cbbeb26dbd92 147
Kojto 100:cbbeb26dbd92 148 uint8_t doublebuffer; /*!< Double buffer enable
Kojto 100:cbbeb26dbd92 149 This parameter can be 0 or 1 */
Kojto 100:cbbeb26dbd92 150
Kojto 100:cbbeb26dbd92 151 uint32_t maxpacket; /*!< Endpoint Max packet size
Kojto 100:cbbeb26dbd92 152 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
Kojto 100:cbbeb26dbd92 153
Kojto 100:cbbeb26dbd92 154 uint8_t *xfer_buff; /*!< Pointer to transfer buffer */
Kojto 100:cbbeb26dbd92 155
Kojto 100:cbbeb26dbd92 156
Kojto 100:cbbeb26dbd92 157 uint32_t xfer_len; /*!< Current transfer length */
Kojto 100:cbbeb26dbd92 158
Kojto 100:cbbeb26dbd92 159 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer */
Kojto 100:cbbeb26dbd92 160
Kojto 100:cbbeb26dbd92 161 }PCD_EPTypeDef;
Kojto 100:cbbeb26dbd92 162
Kojto 100:cbbeb26dbd92 163 typedef USB_TypeDef PCD_TypeDef;
Kojto 100:cbbeb26dbd92 164
Kojto 100:cbbeb26dbd92 165 /**
Kojto 100:cbbeb26dbd92 166 * @brief PCD Handle Structure definition
Kojto 100:cbbeb26dbd92 167 */
Kojto 100:cbbeb26dbd92 168 typedef struct
Kojto 100:cbbeb26dbd92 169 {
Kojto 100:cbbeb26dbd92 170 PCD_TypeDef *Instance; /*!< Register base address */
Kojto 100:cbbeb26dbd92 171 PCD_InitTypeDef Init; /*!< PCD required parameters */
Kojto 100:cbbeb26dbd92 172 __IO uint8_t USB_Address; /*!< USB Address */
Kojto 100:cbbeb26dbd92 173 PCD_EPTypeDef IN_ep[8]; /*!< IN endpoint parameters */
Kojto 100:cbbeb26dbd92 174 PCD_EPTypeDef OUT_ep[8]; /*!< OUT endpoint parameters */
Kojto 100:cbbeb26dbd92 175 HAL_LockTypeDef Lock; /*!< PCD peripheral status */
Kojto 100:cbbeb26dbd92 176 __IO PCD_StateTypeDef State; /*!< PCD communication state */
Kojto 100:cbbeb26dbd92 177 uint32_t Setup[12]; /*!< Setup packet buffer */
Kojto 100:cbbeb26dbd92 178 void *pData; /*!< Pointer to upper stack Handler */
Kojto 100:cbbeb26dbd92 179
Kojto 100:cbbeb26dbd92 180 } PCD_HandleTypeDef;
Kojto 100:cbbeb26dbd92 181
Kojto 100:cbbeb26dbd92 182 /**
Kojto 100:cbbeb26dbd92 183 * @}
Kojto 100:cbbeb26dbd92 184 */
Kojto 100:cbbeb26dbd92 185
Kojto 100:cbbeb26dbd92 186 #include "stm32f3xx_hal_pcd_ex.h"
Kojto 100:cbbeb26dbd92 187 /* Exported constants --------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 188 /** @defgroup PCD_Exported_Constants PCD Exported Constants
Kojto 100:cbbeb26dbd92 189 * @{
Kojto 100:cbbeb26dbd92 190 */
Kojto 100:cbbeb26dbd92 191
Kojto 100:cbbeb26dbd92 192 /** @defgroup USB_Core_Speed USB Core Speed
Kojto 100:cbbeb26dbd92 193 * @{
Kojto 100:cbbeb26dbd92 194 */
Kojto 100:cbbeb26dbd92 195 #define PCD_SPEED_HIGH 0 /* Not Supported */
Kojto 100:cbbeb26dbd92 196 #define PCD_SPEED_FULL 2
Kojto 100:cbbeb26dbd92 197 /**
Kojto 100:cbbeb26dbd92 198 * @}
Kojto 100:cbbeb26dbd92 199 */
Kojto 100:cbbeb26dbd92 200
Kojto 100:cbbeb26dbd92 201 /** @defgroup USB_Core_PHY USB Core PHY
Kojto 100:cbbeb26dbd92 202 * @{
Kojto 100:cbbeb26dbd92 203 */
Kojto 100:cbbeb26dbd92 204 #define PCD_PHY_EMBEDDED 2
Kojto 100:cbbeb26dbd92 205 /**
Kojto 100:cbbeb26dbd92 206 * @}
Kojto 100:cbbeb26dbd92 207 */
Kojto 100:cbbeb26dbd92 208
Kojto 100:cbbeb26dbd92 209 /** @defgroup USB_EP0_MPS USB EP0 MPS
Kojto 100:cbbeb26dbd92 210 * @{
Kojto 100:cbbeb26dbd92 211 */
Kojto 100:cbbeb26dbd92 212 #define DEP0CTL_MPS_64 0
Kojto 100:cbbeb26dbd92 213 #define DEP0CTL_MPS_32 1
Kojto 100:cbbeb26dbd92 214 #define DEP0CTL_MPS_16 2
Kojto 100:cbbeb26dbd92 215 #define DEP0CTL_MPS_8 3
Kojto 100:cbbeb26dbd92 216
Kojto 100:cbbeb26dbd92 217 #define PCD_EP0MPS_64 DEP0CTL_MPS_64
Kojto 100:cbbeb26dbd92 218 #define PCD_EP0MPS_32 DEP0CTL_MPS_32
Kojto 100:cbbeb26dbd92 219 #define PCD_EP0MPS_16 DEP0CTL_MPS_16
Kojto 100:cbbeb26dbd92 220 #define PCD_EP0MPS_08 DEP0CTL_MPS_8
Kojto 100:cbbeb26dbd92 221 /**
Kojto 100:cbbeb26dbd92 222 * @}
Kojto 100:cbbeb26dbd92 223 */
Kojto 100:cbbeb26dbd92 224
Kojto 100:cbbeb26dbd92 225 /** @defgroup USB_EP_Type USB EP Type
Kojto 100:cbbeb26dbd92 226 * @{
Kojto 100:cbbeb26dbd92 227 */
Kojto 100:cbbeb26dbd92 228 #define PCD_EP_TYPE_CTRL 0
Kojto 100:cbbeb26dbd92 229 #define PCD_EP_TYPE_ISOC 1
Kojto 100:cbbeb26dbd92 230 #define PCD_EP_TYPE_BULK 2
Kojto 100:cbbeb26dbd92 231 #define PCD_EP_TYPE_INTR 3
Kojto 100:cbbeb26dbd92 232 /**
Kojto 100:cbbeb26dbd92 233 * @}
Kojto 100:cbbeb26dbd92 234 */
Kojto 100:cbbeb26dbd92 235
Kojto 100:cbbeb26dbd92 236 /** @defgroup USB_ENDP USB ENDP
Kojto 100:cbbeb26dbd92 237 * @{
Kojto 100:cbbeb26dbd92 238 */
Kojto 100:cbbeb26dbd92 239
Kojto 100:cbbeb26dbd92 240 #define PCD_ENDP0 ((uint8_t)0)
Kojto 100:cbbeb26dbd92 241 #define PCD_ENDP1 ((uint8_t)1)
Kojto 100:cbbeb26dbd92 242 #define PCD_ENDP2 ((uint8_t)2)
Kojto 100:cbbeb26dbd92 243 #define PCD_ENDP3 ((uint8_t)3)
Kojto 100:cbbeb26dbd92 244 #define PCD_ENDP4 ((uint8_t)4)
Kojto 100:cbbeb26dbd92 245 #define PCD_ENDP5 ((uint8_t)5)
Kojto 100:cbbeb26dbd92 246 #define PCD_ENDP6 ((uint8_t)6)
Kojto 100:cbbeb26dbd92 247 #define PCD_ENDP7 ((uint8_t)7)
Kojto 100:cbbeb26dbd92 248
Kojto 100:cbbeb26dbd92 249 /* Endpoint Kind */
Kojto 100:cbbeb26dbd92 250 #define PCD_SNG_BUF 0
Kojto 100:cbbeb26dbd92 251 #define PCD_DBL_BUF 1
Kojto 100:cbbeb26dbd92 252
Kojto 100:cbbeb26dbd92 253 #define IS_PCD_ALL_INSTANCE IS_USB_ALL_INSTANCE
Kojto 100:cbbeb26dbd92 254
Kojto 100:cbbeb26dbd92 255 /**
Kojto 100:cbbeb26dbd92 256 * @}
Kojto 100:cbbeb26dbd92 257 */
Kojto 100:cbbeb26dbd92 258
Kojto 100:cbbeb26dbd92 259 /**
Kojto 100:cbbeb26dbd92 260 * @}
Kojto 100:cbbeb26dbd92 261 */
Kojto 100:cbbeb26dbd92 262
Kojto 100:cbbeb26dbd92 263 /* Exported macros -----------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 264
Kojto 100:cbbeb26dbd92 265 /** @defgroup PCD_Exported_Macros PCD Exported Macros
Kojto 100:cbbeb26dbd92 266 * @brief macros to handle interrupts and specific clock configurations
Kojto 100:cbbeb26dbd92 267 * @{
Kojto 100:cbbeb26dbd92 268 */
Kojto 100:cbbeb26dbd92 269 #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->ISTR) & (__INTERRUPT__)) == (__INTERRUPT__))
Kojto 100:cbbeb26dbd92 270 #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->ISTR) = ~(__INTERRUPT__))
Kojto 100:cbbeb26dbd92 271
Kojto 100:cbbeb26dbd92 272 #define USB_EXTI_LINE_WAKEUP ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */
Kojto 100:cbbeb26dbd92 273
Kojto 100:cbbeb26dbd92 274 #define __HAL_USB_EXTI_ENABLE_IT() EXTI->IMR |= USB_EXTI_LINE_WAKEUP
Kojto 100:cbbeb26dbd92 275 #define __HAL_USB_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_EXTI_LINE_WAKEUP)
Kojto 100:cbbeb26dbd92 276 #define __HAL_USB_EXTI_GENERATE_SWIT(__EXTILINE__) (EXTI->SWIER |= (__EXTILINE__))
Kojto 100:cbbeb26dbd92 277
Kojto 100:cbbeb26dbd92 278 #define __HAL_USB_EXTI_GET_FLAG() EXTI->PR & (USB_EXTI_LINE_WAKEUP)
Kojto 100:cbbeb26dbd92 279 #define __HAL_USB_EXTI_CLEAR_FLAG() EXTI->PR = USB_EXTI_LINE_WAKEUP
Kojto 100:cbbeb26dbd92 280
Kojto 100:cbbeb26dbd92 281 #define __HAL_USB_EXTI_SET_RISING_EDGE_TRIGGER() do {\
Kojto 100:cbbeb26dbd92 282 EXTI->FTSR &= ~(USB_EXTI_LINE_WAKEUP);\
Kojto 100:cbbeb26dbd92 283 EXTI->RTSR |= USB_EXTI_LINE_WAKEUP;\
Kojto 100:cbbeb26dbd92 284 } while(0)
Kojto 100:cbbeb26dbd92 285
Kojto 100:cbbeb26dbd92 286 #define __HAL_USB_EXTI_SET_FALLING_EDGE_TRIGGER() do {\
Kojto 100:cbbeb26dbd92 287 EXTI->FTSR |= (USB_EXTI_LINE_WAKEUP);\
Kojto 100:cbbeb26dbd92 288 EXTI->RTSR &= ~(USB_EXTI_LINE_WAKEUP);\
Kojto 100:cbbeb26dbd92 289 } while(0)
Kojto 100:cbbeb26dbd92 290
Kojto 100:cbbeb26dbd92 291 #define __HAL_USB_EXTI_SET_FALLINGRISING_TRIGGER() do {\
Kojto 100:cbbeb26dbd92 292 EXTI->RTSR &= ~(USB_EXTI_LINE_WAKEUP);\
Kojto 100:cbbeb26dbd92 293 EXTI->FTSR &= ~(USB_EXTI_LINE_WAKEUP);\
Kojto 100:cbbeb26dbd92 294 EXTI->RTSR |= USB_EXTI_LINE_WAKEUP;\
Kojto 100:cbbeb26dbd92 295 EXTI->FTSR |= USB_EXTI_LINE_WAKEUP;\
Kojto 100:cbbeb26dbd92 296 } while(0)
Kojto 100:cbbeb26dbd92 297 /**
Kojto 100:cbbeb26dbd92 298 * @}
Kojto 100:cbbeb26dbd92 299 */
Kojto 100:cbbeb26dbd92 300
Kojto 100:cbbeb26dbd92 301 /* Internal macros -----------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 302
Kojto 100:cbbeb26dbd92 303 /** @defgroup PCD_Private_Macros PCD Private Macros
Kojto 100:cbbeb26dbd92 304 * @brief macros to handle interrupts and specific clock configurations
Kojto 100:cbbeb26dbd92 305 * @{
Kojto 100:cbbeb26dbd92 306 */
Kojto 100:cbbeb26dbd92 307
Kojto 100:cbbeb26dbd92 308 /* SetENDPOINT */
Kojto 100:cbbeb26dbd92 309 #define PCD_SET_ENDPOINT(USBx, bEpNum,wRegValue) (*(&USBx->EP0R + bEpNum * 2)= (uint16_t)wRegValue)
Kojto 100:cbbeb26dbd92 310
Kojto 100:cbbeb26dbd92 311 /* GetENDPOINT */
Kojto 100:cbbeb26dbd92 312 #define PCD_GET_ENDPOINT(USBx, bEpNum) (*(&USBx->EP0R + bEpNum * 2))
Kojto 100:cbbeb26dbd92 313
Kojto 100:cbbeb26dbd92 314
Kojto 100:cbbeb26dbd92 315
Kojto 100:cbbeb26dbd92 316 /**
Kojto 100:cbbeb26dbd92 317 * @brief sets the type in the endpoint register(bits EP_TYPE[1:0])
Kojto 100:cbbeb26dbd92 318 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 319 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 320 * @param wType: Endpoint Type.
Kojto 100:cbbeb26dbd92 321 * @retval None
Kojto 100:cbbeb26dbd92 322 */
Kojto 100:cbbeb26dbd92 323 #define PCD_SET_EPTYPE(USBx, bEpNum,wType) (PCD_SET_ENDPOINT(USBx, bEpNum,\
Kojto 100:cbbeb26dbd92 324 ((PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EP_T_MASK) | wType )))
Kojto 100:cbbeb26dbd92 325
Kojto 100:cbbeb26dbd92 326 /**
Kojto 100:cbbeb26dbd92 327 * @brief gets the type in the endpoint register(bits EP_TYPE[1:0])
Kojto 100:cbbeb26dbd92 328 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 329 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 330 * @retval Endpoint Type
Kojto 100:cbbeb26dbd92 331 */
Kojto 100:cbbeb26dbd92 332 #define PCD_GET_EPTYPE(USBx, bEpNum) (PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EP_T_FIELD)
Kojto 100:cbbeb26dbd92 333
Kojto 100:cbbeb26dbd92 334
Kojto 100:cbbeb26dbd92 335 /**
Kojto 100:cbbeb26dbd92 336 * @brief free buffer used from the application realizing it to the line
Kojto 100:cbbeb26dbd92 337 toggles bit SW_BUF in the double buffered endpoint register
Kojto 100:cbbeb26dbd92 338 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 339 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 340 * @param bDir: Direction
Kojto 100:cbbeb26dbd92 341 * @retval None
Kojto 100:cbbeb26dbd92 342 */
Kojto 100:cbbeb26dbd92 343 #define PCD_FreeUserBuffer(USBx, bEpNum, bDir)\
Kojto 100:cbbeb26dbd92 344 {\
Kojto 100:cbbeb26dbd92 345 if (bDir == PCD_EP_DBUF_OUT)\
Kojto 100:cbbeb26dbd92 346 { /* OUT double buffered endpoint */\
Kojto 100:cbbeb26dbd92 347 PCD_TX_DTOG(USBx, bEpNum);\
Kojto 100:cbbeb26dbd92 348 }\
Kojto 100:cbbeb26dbd92 349 else if (bDir == PCD_EP_DBUF_IN)\
Kojto 100:cbbeb26dbd92 350 { /* IN double buffered endpoint */\
Kojto 100:cbbeb26dbd92 351 PCD_RX_DTOG(USBx, bEpNum);\
Kojto 100:cbbeb26dbd92 352 }\
Kojto 100:cbbeb26dbd92 353 }
Kojto 100:cbbeb26dbd92 354
Kojto 100:cbbeb26dbd92 355 /**
Kojto 100:cbbeb26dbd92 356 * @brief gets direction of the double buffered endpoint
Kojto 100:cbbeb26dbd92 357 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 358 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 359 * @retval EP_DBUF_OUT, EP_DBUF_IN,
Kojto 100:cbbeb26dbd92 360 * EP_DBUF_ERR if the endpoint counter not yet programmed.
Kojto 100:cbbeb26dbd92 361 */
Kojto 100:cbbeb26dbd92 362 #define PCD_GET_DB_DIR(USBx, bEpNum)\
Kojto 100:cbbeb26dbd92 363 {\
Kojto 100:cbbeb26dbd92 364 if ((uint16_t)(*PCD_EP_RX_CNT(USBx, bEpNum) & 0xFC00) != 0)\
Kojto 100:cbbeb26dbd92 365 return(PCD_EP_DBUF_OUT);\
Kojto 100:cbbeb26dbd92 366 else if (((uint16_t)(*PCD_EP_TX_CNT(USBx, bEpNum)) & 0x03FF) != 0)\
Kojto 100:cbbeb26dbd92 367 return(PCD_EP_DBUF_IN);\
Kojto 100:cbbeb26dbd92 368 else\
Kojto 100:cbbeb26dbd92 369 return(PCD_EP_DBUF_ERR);\
Kojto 100:cbbeb26dbd92 370 }
Kojto 100:cbbeb26dbd92 371
Kojto 100:cbbeb26dbd92 372 /**
Kojto 100:cbbeb26dbd92 373 * @brief sets the status for tx transfer (bits STAT_TX[1:0]).
Kojto 100:cbbeb26dbd92 374 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 375 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 376 * @param wState: new state
Kojto 100:cbbeb26dbd92 377 * @retval None
Kojto 100:cbbeb26dbd92 378 */
Kojto 100:cbbeb26dbd92 379 #define PCD_SET_EP_TX_STATUS(USBx, bEpNum, wState) {\
Kojto 100:cbbeb26dbd92 380 register uint16_t _wRegVal; \
Kojto 100:cbbeb26dbd92 381 \
Kojto 100:cbbeb26dbd92 382 _wRegVal = PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPTX_DTOGMASK;\
Kojto 100:cbbeb26dbd92 383 /* toggle first bit ? */ \
Kojto 100:cbbeb26dbd92 384 if((USB_EPTX_DTOG1 & wState)!= 0) \
Kojto 100:cbbeb26dbd92 385 _wRegVal ^= USB_EPTX_DTOG1; \
Kojto 100:cbbeb26dbd92 386 /* toggle second bit ? */ \
Kojto 100:cbbeb26dbd92 387 if((USB_EPTX_DTOG2 & wState)!= 0) \
Kojto 100:cbbeb26dbd92 388 _wRegVal ^= USB_EPTX_DTOG2; \
Kojto 100:cbbeb26dbd92 389 PCD_SET_ENDPOINT(USBx, bEpNum, (_wRegVal | USB_EP_CTR_RX|USB_EP_CTR_TX)); \
Kojto 100:cbbeb26dbd92 390 } /* PCD_SET_EP_TX_STATUS */
Kojto 100:cbbeb26dbd92 391
Kojto 100:cbbeb26dbd92 392 /**
Kojto 100:cbbeb26dbd92 393 * @brief sets the status for rx transfer (bits STAT_TX[1:0])
Kojto 100:cbbeb26dbd92 394 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 395 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 396 * @param wState: new state
Kojto 100:cbbeb26dbd92 397 * @retval None
Kojto 100:cbbeb26dbd92 398 */
Kojto 100:cbbeb26dbd92 399 #define PCD_SET_EP_RX_STATUS(USBx, bEpNum,wState) {\
Kojto 100:cbbeb26dbd92 400 register uint16_t _wRegVal; \
Kojto 100:cbbeb26dbd92 401 \
Kojto 100:cbbeb26dbd92 402 _wRegVal = PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPRX_DTOGMASK;\
Kojto 100:cbbeb26dbd92 403 /* toggle first bit ? */ \
Kojto 100:cbbeb26dbd92 404 if((USB_EPRX_DTOG1 & wState)!= 0) \
Kojto 100:cbbeb26dbd92 405 _wRegVal ^= USB_EPRX_DTOG1; \
Kojto 100:cbbeb26dbd92 406 /* toggle second bit ? */ \
Kojto 100:cbbeb26dbd92 407 if((USB_EPRX_DTOG2 & wState)!= 0) \
Kojto 100:cbbeb26dbd92 408 _wRegVal ^= USB_EPRX_DTOG2; \
Kojto 100:cbbeb26dbd92 409 PCD_SET_ENDPOINT(USBx, bEpNum, (_wRegVal | USB_EP_CTR_RX|USB_EP_CTR_TX)); \
Kojto 100:cbbeb26dbd92 410 } /* PCD_SET_EP_RX_STATUS */
Kojto 100:cbbeb26dbd92 411
Kojto 100:cbbeb26dbd92 412 /**
Kojto 100:cbbeb26dbd92 413 * @brief sets the status for rx & tx (bits STAT_TX[1:0] & STAT_RX[1:0])
Kojto 100:cbbeb26dbd92 414 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 415 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 416 * @param wStaterx: new state.
Kojto 100:cbbeb26dbd92 417 * @param wStatetx: new state.
Kojto 100:cbbeb26dbd92 418 * @retval None
Kojto 100:cbbeb26dbd92 419 */
Kojto 100:cbbeb26dbd92 420 #define PCD_SET_EP_TXRX_STATUS(USBx,bEpNum,wStaterx,wStatetx) {\
Kojto 100:cbbeb26dbd92 421 register uint32_t _wRegVal; \
Kojto 100:cbbeb26dbd92 422 \
Kojto 100:cbbeb26dbd92 423 _wRegVal = PCD_GET_ENDPOINT(USBx, bEpNum) & (USB_EPRX_DTOGMASK |USB_EPTX_STAT) ;\
Kojto 100:cbbeb26dbd92 424 /* toggle first bit ? */ \
Kojto 100:cbbeb26dbd92 425 if((USB_EPRX_DTOG1 & wStaterx)!= 0) \
Kojto 100:cbbeb26dbd92 426 _wRegVal ^= USB_EPRX_DTOG1; \
Kojto 100:cbbeb26dbd92 427 /* toggle second bit ? */ \
Kojto 100:cbbeb26dbd92 428 if((USB_EPRX_DTOG2 & wStaterx)!= 0) \
Kojto 100:cbbeb26dbd92 429 _wRegVal ^= USB_EPRX_DTOG2; \
Kojto 100:cbbeb26dbd92 430 /* toggle first bit ? */ \
Kojto 100:cbbeb26dbd92 431 if((USB_EPTX_DTOG1 & wStatetx)!= 0) \
Kojto 100:cbbeb26dbd92 432 _wRegVal ^= USB_EPTX_DTOG1; \
Kojto 100:cbbeb26dbd92 433 /* toggle second bit ? */ \
Kojto 100:cbbeb26dbd92 434 if((USB_EPTX_DTOG2 & wStatetx)!= 0) \
Kojto 100:cbbeb26dbd92 435 _wRegVal ^= USB_EPTX_DTOG2; \
Kojto 100:cbbeb26dbd92 436 PCD_SET_ENDPOINT(USBx, bEpNum, _wRegVal | USB_EP_CTR_RX|USB_EP_CTR_TX); \
Kojto 100:cbbeb26dbd92 437 } /* PCD_SET_EP_TXRX_STATUS */
Kojto 100:cbbeb26dbd92 438
Kojto 100:cbbeb26dbd92 439 /**
Kojto 100:cbbeb26dbd92 440 * @brief gets the status for tx/rx transfer (bits STAT_TX[1:0]
Kojto 100:cbbeb26dbd92 441 * /STAT_RX[1:0])
Kojto 100:cbbeb26dbd92 442 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 443 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 444 * @retval status
Kojto 100:cbbeb26dbd92 445 */
Kojto 100:cbbeb26dbd92 446 #define PCD_GET_EP_TX_STATUS(USBx, bEpNum) ((uint16_t)PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPTX_STAT)
Kojto 100:cbbeb26dbd92 447
Kojto 100:cbbeb26dbd92 448 #define PCD_GET_EP_RX_STATUS(USBx, bEpNum) ((uint16_t)PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPRX_STAT)
Kojto 100:cbbeb26dbd92 449
Kojto 100:cbbeb26dbd92 450 /**
Kojto 100:cbbeb26dbd92 451 * @brief sets directly the VALID tx/rx-status into the endpoint register
Kojto 100:cbbeb26dbd92 452 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 453 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 454 * @retval None
Kojto 100:cbbeb26dbd92 455 */
Kojto 100:cbbeb26dbd92 456 #define PCD_SET_EP_TX_VALID(USBx, bEpNum) (PCD_SET_EP_TX_STATUS(USBx, bEpNum, USB_EP_TX_VALID))
Kojto 100:cbbeb26dbd92 457
Kojto 100:cbbeb26dbd92 458 #define PCD_SET_EP_RX_VALID(USBx, bEpNum) (PCD_SET_EP_RX_STATUS(USBx, bEpNum, USB_EP_RX_VALID))
Kojto 100:cbbeb26dbd92 459
Kojto 100:cbbeb26dbd92 460 /**
Kojto 100:cbbeb26dbd92 461 * @brief checks stall condition in an endpoint.
Kojto 100:cbbeb26dbd92 462 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 463 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 464 * @retval TRUE = endpoint in stall condition.
Kojto 100:cbbeb26dbd92 465 */
Kojto 100:cbbeb26dbd92 466 #define PCD_GET_EP_TX_STALL_STATUS(USBx, bEpNum) (PCD_GET_EP_TX_STATUS(USBx, bEpNum) \
Kojto 100:cbbeb26dbd92 467 == USB_EP_TX_STALL)
Kojto 100:cbbeb26dbd92 468 #define PCD_GET_EP_RX_STALL_STATUS(USBx, bEpNum) (PCD_GET_EP_RX_STATUS(USBx, bEpNum) \
Kojto 100:cbbeb26dbd92 469 == USB_EP_RX_STALL)
Kojto 100:cbbeb26dbd92 470
Kojto 100:cbbeb26dbd92 471 /**
Kojto 100:cbbeb26dbd92 472 * @brief set & clear EP_KIND bit.
Kojto 100:cbbeb26dbd92 473 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 474 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 475 * @retval None
Kojto 100:cbbeb26dbd92 476 */
Kojto 100:cbbeb26dbd92 477 #define PCD_SET_EP_KIND(USBx, bEpNum) (PCD_SET_ENDPOINT(USBx, bEpNum, \
Kojto 100:cbbeb26dbd92 478 (USB_EP_CTR_RX|USB_EP_CTR_TX|((PCD_GET_ENDPOINT(USBx, bEpNum) | USB_EP_KIND) & USB_EPREG_MASK))))
Kojto 100:cbbeb26dbd92 479 #define PCD_CLEAR_EP_KIND(USBx, bEpNum) (PCD_SET_ENDPOINT(USBx, bEpNum, \
Kojto 100:cbbeb26dbd92 480 (USB_EP_CTR_RX|USB_EP_CTR_TX|(PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPKIND_MASK))))
Kojto 100:cbbeb26dbd92 481
Kojto 100:cbbeb26dbd92 482 /**
Kojto 100:cbbeb26dbd92 483 * @brief Sets/clears directly STATUS_OUT bit in the endpoint register.
Kojto 100:cbbeb26dbd92 484 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 485 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 486 * @retval None
Kojto 100:cbbeb26dbd92 487 */
Kojto 100:cbbeb26dbd92 488 #define PCD_SET_OUT_STATUS(USBx, bEpNum) PCD_SET_EP_KIND(USBx, bEpNum)
Kojto 100:cbbeb26dbd92 489 #define PCD_CLEAR_OUT_STATUS(USBx, bEpNum) PCD_CLEAR_EP_KIND(USBx, bEpNum)
Kojto 100:cbbeb26dbd92 490
Kojto 100:cbbeb26dbd92 491 /**
Kojto 100:cbbeb26dbd92 492 * @brief Sets/clears directly EP_KIND bit in the endpoint register.
Kojto 100:cbbeb26dbd92 493 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 494 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 495 * @retval None
Kojto 100:cbbeb26dbd92 496 */
Kojto 100:cbbeb26dbd92 497 #define PCD_SET_EP_DBUF(USBx, bEpNum) PCD_SET_EP_KIND(USBx, bEpNum)
Kojto 100:cbbeb26dbd92 498 #define PCD_CLEAR_EP_DBUF(USBx, bEpNum) PCD_CLEAR_EP_KIND(USBx, bEpNum)
Kojto 100:cbbeb26dbd92 499
Kojto 100:cbbeb26dbd92 500 /**
Kojto 100:cbbeb26dbd92 501 * @brief Clears bit CTR_RX / CTR_TX in the endpoint register.
Kojto 100:cbbeb26dbd92 502 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 503 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 504 * @retval None
Kojto 100:cbbeb26dbd92 505 */
Kojto 100:cbbeb26dbd92 506 #define PCD_CLEAR_RX_EP_CTR(USBx, bEpNum) (PCD_SET_ENDPOINT(USBx, bEpNum,\
Kojto 100:cbbeb26dbd92 507 PCD_GET_ENDPOINT(USBx, bEpNum) & 0x7FFF & USB_EPREG_MASK))
Kojto 100:cbbeb26dbd92 508 #define PCD_CLEAR_TX_EP_CTR(USBx, bEpNum) (PCD_SET_ENDPOINT(USBx, bEpNum,\
Kojto 100:cbbeb26dbd92 509 PCD_GET_ENDPOINT(USBx, bEpNum) & 0xFF7F & USB_EPREG_MASK))
Kojto 100:cbbeb26dbd92 510
Kojto 100:cbbeb26dbd92 511 /**
Kojto 100:cbbeb26dbd92 512 * @brief Toggles DTOG_RX / DTOG_TX bit in the endpoint register.
Kojto 100:cbbeb26dbd92 513 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 514 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 515 * @retval None
Kojto 100:cbbeb26dbd92 516 */
Kojto 100:cbbeb26dbd92 517 #define PCD_RX_DTOG(USBx, bEpNum) (PCD_SET_ENDPOINT(USBx, bEpNum, \
Kojto 100:cbbeb26dbd92 518 USB_EP_CTR_RX|USB_EP_CTR_TX|USB_EP_DTOG_RX | (PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPREG_MASK)))
Kojto 100:cbbeb26dbd92 519 #define PCD_TX_DTOG(USBx, bEpNum) (PCD_SET_ENDPOINT(USBx, bEpNum, \
Kojto 100:cbbeb26dbd92 520 USB_EP_CTR_RX|USB_EP_CTR_TX|USB_EP_DTOG_TX | (PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPREG_MASK)))
Kojto 100:cbbeb26dbd92 521
Kojto 100:cbbeb26dbd92 522 /**
Kojto 100:cbbeb26dbd92 523 * @brief Clears DTOG_RX / DTOG_TX bit in the endpoint register.
Kojto 100:cbbeb26dbd92 524 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 525 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 526 * @retval None
Kojto 100:cbbeb26dbd92 527 */
Kojto 100:cbbeb26dbd92 528 #define PCD_CLEAR_RX_DTOG(USBx, bEpNum) if((PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EP_DTOG_RX) != 0)\
Kojto 100:cbbeb26dbd92 529 PCD_RX_DTOG(USBx, bEpNum)
Kojto 100:cbbeb26dbd92 530 #define PCD_CLEAR_TX_DTOG(USBx, bEpNum) if((PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EP_DTOG_TX) != 0)\
Kojto 100:cbbeb26dbd92 531 PCD_TX_DTOG(USBx, bEpNum)
Kojto 100:cbbeb26dbd92 532
Kojto 100:cbbeb26dbd92 533 /**
Kojto 100:cbbeb26dbd92 534 * @brief Sets address in an endpoint register.
Kojto 100:cbbeb26dbd92 535 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 536 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 537 * @param bAddr: Address.
Kojto 100:cbbeb26dbd92 538 * @retval None
Kojto 100:cbbeb26dbd92 539 */
Kojto 100:cbbeb26dbd92 540 #define PCD_SET_EP_ADDRESS(USBx, bEpNum,bAddr) PCD_SET_ENDPOINT(USBx, bEpNum,\
Kojto 100:cbbeb26dbd92 541 USB_EP_CTR_RX|USB_EP_CTR_TX|(PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPREG_MASK) | bAddr)
Kojto 100:cbbeb26dbd92 542
Kojto 100:cbbeb26dbd92 543 #define PCD_GET_EP_ADDRESS(USBx, bEpNum) ((uint8_t)(PCD_GET_ENDPOINT(USBx, bEpNum) & USB_EPADDR_FIELD))
Kojto 100:cbbeb26dbd92 544
Kojto 100:cbbeb26dbd92 545 /**
Kojto 100:cbbeb26dbd92 546 * @brief sets address of the tx/rx buffer.
Kojto 100:cbbeb26dbd92 547 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 548 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 549 * @param wAddr: address to be set (must be word aligned).
Kojto 100:cbbeb26dbd92 550 * @retval None
Kojto 100:cbbeb26dbd92 551 */
Kojto 100:cbbeb26dbd92 552 #define PCD_SET_EP_TX_ADDRESS(USBx, bEpNum,wAddr) (*PCD_EP_TX_ADDRESS(USBx, bEpNum) = ((wAddr >> 1) << 1))
Kojto 100:cbbeb26dbd92 553 #define PCD_SET_EP_RX_ADDRESS(USBx, bEpNum,wAddr) (*PCD_EP_RX_ADDRESS(USBx, bEpNum) = ((wAddr >> 1) << 1))
Kojto 100:cbbeb26dbd92 554
Kojto 100:cbbeb26dbd92 555 /**
Kojto 100:cbbeb26dbd92 556 * @brief Gets address of the tx/rx buffer.
Kojto 100:cbbeb26dbd92 557 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 558 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 559 * @retval address of the buffer.
Kojto 100:cbbeb26dbd92 560 */
Kojto 100:cbbeb26dbd92 561 #define PCD_GET_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t)*PCD_EP_TX_ADDRESS(USBx, bEpNum))
Kojto 100:cbbeb26dbd92 562 #define PCD_GET_EP_RX_ADDRESS(USBx, bEpNum) ((uint16_t)*PCD_EP_RX_ADDRESS(USBx, bEpNum))
Kojto 100:cbbeb26dbd92 563
Kojto 100:cbbeb26dbd92 564 /**
Kojto 100:cbbeb26dbd92 565 * @brief Sets counter of rx buffer with no. of blocks.
Kojto 100:cbbeb26dbd92 566 * @param dwReg: Register
Kojto 100:cbbeb26dbd92 567 * @param wCount: Counter.
Kojto 100:cbbeb26dbd92 568 * @param wNBlocks: no. of Blocks.
Kojto 100:cbbeb26dbd92 569 * @retval None
Kojto 100:cbbeb26dbd92 570 */
Kojto 100:cbbeb26dbd92 571 #define PCD_CALC_BLK32(dwReg,wCount,wNBlocks) {\
Kojto 100:cbbeb26dbd92 572 wNBlocks = wCount >> 5;\
Kojto 100:cbbeb26dbd92 573 if((wCount & 0x1f) == 0)\
Kojto 100:cbbeb26dbd92 574 wNBlocks--;\
Kojto 100:cbbeb26dbd92 575 *pdwReg = (uint16_t)((wNBlocks << 10) | 0x8000);\
Kojto 100:cbbeb26dbd92 576 }/* PCD_CALC_BLK32 */
Kojto 100:cbbeb26dbd92 577
Kojto 100:cbbeb26dbd92 578 #define PCD_CALC_BLK2(dwReg,wCount,wNBlocks) {\
Kojto 100:cbbeb26dbd92 579 wNBlocks = wCount >> 1;\
Kojto 100:cbbeb26dbd92 580 if((wCount & 0x1) != 0)\
Kojto 100:cbbeb26dbd92 581 wNBlocks++;\
Kojto 100:cbbeb26dbd92 582 *pdwReg = (uint16_t)(wNBlocks << 10);\
Kojto 100:cbbeb26dbd92 583 }/* PCD_CALC_BLK2 */
Kojto 100:cbbeb26dbd92 584
Kojto 100:cbbeb26dbd92 585 #define PCD_SET_EP_CNT_RX_REG(dwReg,wCount) {\
Kojto 100:cbbeb26dbd92 586 uint16_t wNBlocks;\
Kojto 100:cbbeb26dbd92 587 if(wCount > 62){PCD_CALC_BLK32(dwReg,wCount,wNBlocks);}\
Kojto 100:cbbeb26dbd92 588 else {PCD_CALC_BLK2(dwReg,wCount,wNBlocks);}\
Kojto 100:cbbeb26dbd92 589 }/* PCD_SET_EP_CNT_RX_REG */
Kojto 100:cbbeb26dbd92 590
Kojto 100:cbbeb26dbd92 591 #define PCD_SET_EP_RX_DBUF0_CNT(USBx, bEpNum,wCount) {\
Kojto 100:cbbeb26dbd92 592 uint16_t *pdwReg = PCD_EP_TX_CNT(USBx, bEpNum); \
Kojto 100:cbbeb26dbd92 593 PCD_SET_EP_CNT_RX_REG(pdwReg, wCount);\
Kojto 100:cbbeb26dbd92 594 }
Kojto 100:cbbeb26dbd92 595 /**
Kojto 100:cbbeb26dbd92 596 * @brief sets counter for the tx/rx buffer.
Kojto 100:cbbeb26dbd92 597 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 598 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 599 * @param wCount: Counter value.
Kojto 100:cbbeb26dbd92 600 * @retval None
Kojto 100:cbbeb26dbd92 601 */
Kojto 100:cbbeb26dbd92 602 #define PCD_SET_EP_TX_CNT(USBx, bEpNum,wCount) (*PCD_EP_TX_CNT(USBx, bEpNum) = wCount)
Kojto 100:cbbeb26dbd92 603
Kojto 100:cbbeb26dbd92 604
Kojto 100:cbbeb26dbd92 605 /**
Kojto 100:cbbeb26dbd92 606 * @brief gets counter of the tx buffer.
Kojto 100:cbbeb26dbd92 607 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 608 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 609 * @retval Counter value
Kojto 100:cbbeb26dbd92 610 */
Kojto 100:cbbeb26dbd92 611 #define PCD_GET_EP_TX_CNT(USBx, bEpNum)((uint16_t)(*PCD_EP_TX_CNT(USBx, bEpNum)) & 0x3ff)
Kojto 100:cbbeb26dbd92 612 #define PCD_GET_EP_RX_CNT(USBx, bEpNum)((uint16_t)(*PCD_EP_RX_CNT(USBx, bEpNum)) & 0x3ff)
Kojto 100:cbbeb26dbd92 613
Kojto 100:cbbeb26dbd92 614 /**
Kojto 100:cbbeb26dbd92 615 * @brief Sets buffer 0/1 address in a double buffer endpoint.
Kojto 100:cbbeb26dbd92 616 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 617 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 618 * @param wBuf0Addr: buffer 0 address.
Kojto 100:cbbeb26dbd92 619 * @retval Counter value
Kojto 100:cbbeb26dbd92 620 */
Kojto 100:cbbeb26dbd92 621 #define PCD_SET_EP_DBUF0_ADDR(USBx, bEpNum,wBuf0Addr) {PCD_SET_EP_TX_ADDRESS(USBx, bEpNum, wBuf0Addr);}
Kojto 100:cbbeb26dbd92 622 #define PCD_SET_EP_DBUF1_ADDR(USBx, bEpNum,wBuf1Addr) {PCD_SET_EP_RX_ADDRESS(USBx, bEpNum, wBuf1Addr);}
Kojto 100:cbbeb26dbd92 623
Kojto 100:cbbeb26dbd92 624 /**
Kojto 100:cbbeb26dbd92 625 * @brief Sets addresses in a double buffer endpoint.
Kojto 100:cbbeb26dbd92 626 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 627 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 628 * @param wBuf0Addr: buffer 0 address.
Kojto 100:cbbeb26dbd92 629 * @param wBuf1Addr = buffer 1 address.
Kojto 100:cbbeb26dbd92 630 * @retval None
Kojto 100:cbbeb26dbd92 631 */
Kojto 100:cbbeb26dbd92 632 #define PCD_SET_EP_DBUF_ADDR(USBx, bEpNum,wBuf0Addr,wBuf1Addr) { \
Kojto 100:cbbeb26dbd92 633 PCD_SET_EP_DBUF0_ADDR(USBx, bEpNum, wBuf0Addr);\
Kojto 100:cbbeb26dbd92 634 PCD_SET_EP_DBUF1_ADDR(USBx, bEpNum, wBuf1Addr);\
Kojto 100:cbbeb26dbd92 635 } /* PCD_SET_EP_DBUF_ADDR */
Kojto 100:cbbeb26dbd92 636
Kojto 100:cbbeb26dbd92 637 /**
Kojto 100:cbbeb26dbd92 638 * @brief Gets buffer 0/1 address of a double buffer endpoint.
Kojto 100:cbbeb26dbd92 639 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 640 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 641 * @retval None
Kojto 100:cbbeb26dbd92 642 */
Kojto 100:cbbeb26dbd92 643 #define PCD_GET_EP_DBUF0_ADDR(USBx, bEpNum) (PCD_GET_EP_TX_ADDRESS(USBx, bEpNum))
Kojto 100:cbbeb26dbd92 644 #define PCD_GET_EP_DBUF1_ADDR(USBx, bEpNum) (PCD_GET_EP_RX_ADDRESS(USBx, bEpNum))
Kojto 100:cbbeb26dbd92 645
Kojto 100:cbbeb26dbd92 646 /**
Kojto 100:cbbeb26dbd92 647 * @brief Gets buffer 0/1 address of a double buffer endpoint.
Kojto 100:cbbeb26dbd92 648 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 649 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 650 * @param bDir: endpoint dir EP_DBUF_OUT = OUT
Kojto 100:cbbeb26dbd92 651 * EP_DBUF_IN = IN
Kojto 100:cbbeb26dbd92 652 * @param wCount: Counter value
Kojto 100:cbbeb26dbd92 653 * @retval None
Kojto 100:cbbeb26dbd92 654 */
Kojto 100:cbbeb26dbd92 655 #define PCD_SET_EP_DBUF0_CNT(USBx, bEpNum, bDir, wCount) { \
Kojto 100:cbbeb26dbd92 656 if(bDir == PCD_EP_DBUF_OUT)\
Kojto 100:cbbeb26dbd92 657 /* OUT endpoint */ \
Kojto 100:cbbeb26dbd92 658 {PCD_SET_EP_RX_DBUF0_CNT(USBx, bEpNum,wCount);} \
Kojto 100:cbbeb26dbd92 659 else if(bDir == PCD_EP_DBUF_IN)\
Kojto 100:cbbeb26dbd92 660 /* IN endpoint */ \
Kojto 100:cbbeb26dbd92 661 *PCD_EP_TX_CNT(USBx, bEpNum) = (uint32_t)wCount; \
Kojto 100:cbbeb26dbd92 662 } /* SetEPDblBuf0Count*/
Kojto 100:cbbeb26dbd92 663
Kojto 100:cbbeb26dbd92 664 #define PCD_SET_EP_DBUF1_CNT(USBx, bEpNum, bDir, wCount) { \
Kojto 100:cbbeb26dbd92 665 if(bDir == PCD_EP_DBUF_OUT)\
Kojto 100:cbbeb26dbd92 666 /* OUT endpoint */ \
Kojto 100:cbbeb26dbd92 667 {PCD_SET_EP_RX_CNT(USBx, bEpNum,wCount);}\
Kojto 100:cbbeb26dbd92 668 else if(bDir == PCD_EP_DBUF_IN)\
Kojto 100:cbbeb26dbd92 669 /* IN endpoint */\
Kojto 100:cbbeb26dbd92 670 *PCD_EP_RX_CNT(USBx, bEpNum) = (uint32_t)wCount; \
Kojto 100:cbbeb26dbd92 671 } /* SetEPDblBuf1Count */
Kojto 100:cbbeb26dbd92 672
Kojto 100:cbbeb26dbd92 673 #define PCD_SET_EP_DBUF_CNT(USBx, bEpNum, bDir, wCount) {\
Kojto 100:cbbeb26dbd92 674 PCD_SET_EP_DBUF0_CNT(USBx, bEpNum, bDir, wCount); \
Kojto 100:cbbeb26dbd92 675 PCD_SET_EP_DBUF1_CNT(USBx, bEpNum, bDir, wCount); \
Kojto 100:cbbeb26dbd92 676 } /* PCD_SET_EP_DBUF_CNT */
Kojto 100:cbbeb26dbd92 677
Kojto 100:cbbeb26dbd92 678 /**
Kojto 100:cbbeb26dbd92 679 * @brief Gets buffer 0/1 rx/tx counter for double buffering.
Kojto 100:cbbeb26dbd92 680 * @param USBx: USB peripheral instance register address.
Kojto 100:cbbeb26dbd92 681 * @param bEpNum: Endpoint Number.
Kojto 100:cbbeb26dbd92 682 * @retval None
Kojto 100:cbbeb26dbd92 683 */
Kojto 100:cbbeb26dbd92 684 #define PCD_GET_EP_DBUF0_CNT(USBx, bEpNum) (PCD_GET_EP_TX_CNT(USBx, bEpNum))
Kojto 100:cbbeb26dbd92 685 #define PCD_GET_EP_DBUF1_CNT(USBx, bEpNum) (PCD_GET_EP_RX_CNT(USBx, bEpNum))
Kojto 100:cbbeb26dbd92 686
Kojto 100:cbbeb26dbd92 687
Kojto 100:cbbeb26dbd92 688 /**
Kojto 100:cbbeb26dbd92 689 * @}
Kojto 100:cbbeb26dbd92 690 */
Kojto 100:cbbeb26dbd92 691
Kojto 100:cbbeb26dbd92 692 /* Exported functions --------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 693
Kojto 100:cbbeb26dbd92 694 /** @addtogroup PCD_Exported_Functions
Kojto 100:cbbeb26dbd92 695 * @{
Kojto 100:cbbeb26dbd92 696 */
Kojto 100:cbbeb26dbd92 697
Kojto 100:cbbeb26dbd92 698 /** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions
Kojto 100:cbbeb26dbd92 699 * @{
Kojto 100:cbbeb26dbd92 700 */
Kojto 100:cbbeb26dbd92 701 /* Initialization/de-initialization functions **********************************/
Kojto 100:cbbeb26dbd92 702 HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 703 HAL_StatusTypeDef HAL_PCD_DeInit (PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 704 void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 705 void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 706
Kojto 100:cbbeb26dbd92 707 /**
Kojto 100:cbbeb26dbd92 708 * @}
Kojto 100:cbbeb26dbd92 709 */
Kojto 100:cbbeb26dbd92 710
Kojto 100:cbbeb26dbd92 711 /** @addtogroup PCD_Exported_Functions_Group2 Input and Output operation functions
Kojto 100:cbbeb26dbd92 712 * @{
Kojto 100:cbbeb26dbd92 713 */
Kojto 100:cbbeb26dbd92 714 /* I/O operation functions *****************************************************/
Kojto 100:cbbeb26dbd92 715 /* Non-Blocking mode: Interrupt */
Kojto 100:cbbeb26dbd92 716 HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 717 HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 718 void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 719
Kojto 100:cbbeb26dbd92 720 void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 100:cbbeb26dbd92 721 void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 100:cbbeb26dbd92 722 void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 723 void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 724 void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 725 void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 726 void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 727 void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 100:cbbeb26dbd92 728 void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
Kojto 100:cbbeb26dbd92 729 void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 730 void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 731
Kojto 100:cbbeb26dbd92 732 /**
Kojto 100:cbbeb26dbd92 733 * @}
Kojto 100:cbbeb26dbd92 734 */
Kojto 100:cbbeb26dbd92 735
Kojto 100:cbbeb26dbd92 736 /** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions
Kojto 100:cbbeb26dbd92 737 * @{
Kojto 100:cbbeb26dbd92 738 */
Kojto 100:cbbeb26dbd92 739 /* Peripheral Control functions ************************************************/
Kojto 100:cbbeb26dbd92 740 HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 741 HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 742 HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address);
Kojto 100:cbbeb26dbd92 743 HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type);
Kojto 100:cbbeb26dbd92 744 HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 100:cbbeb26dbd92 745 HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
Kojto 100:cbbeb26dbd92 746 HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
Kojto 100:cbbeb26dbd92 747 uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 100:cbbeb26dbd92 748 HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 100:cbbeb26dbd92 749 HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 100:cbbeb26dbd92 750 HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
Kojto 100:cbbeb26dbd92 751 HAL_StatusTypeDef HAL_PCD_ActiveRemoteWakeup(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 752 HAL_StatusTypeDef HAL_PCD_DeActiveRemoteWakeup(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 753 /**
Kojto 100:cbbeb26dbd92 754 * @}
Kojto 100:cbbeb26dbd92 755 */
Kojto 100:cbbeb26dbd92 756
Kojto 100:cbbeb26dbd92 757 /** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
Kojto 100:cbbeb26dbd92 758 * @{
Kojto 100:cbbeb26dbd92 759 */
Kojto 100:cbbeb26dbd92 760 /* Peripheral State functions **************************************************/
Kojto 100:cbbeb26dbd92 761 PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
Kojto 100:cbbeb26dbd92 762 /**
Kojto 100:cbbeb26dbd92 763 * @}
Kojto 100:cbbeb26dbd92 764 */
Kojto 100:cbbeb26dbd92 765
Kojto 100:cbbeb26dbd92 766 /** @addtogroup PCDEx_Private_Functions PCD Extended Private Functions
Kojto 100:cbbeb26dbd92 767 * @{
Kojto 100:cbbeb26dbd92 768 */
Kojto 100:cbbeb26dbd92 769 void PCD_WritePMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes);
Kojto 100:cbbeb26dbd92 770 void PCD_ReadPMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes);
Kojto 100:cbbeb26dbd92 771 /**
Kojto 100:cbbeb26dbd92 772 * @}
Kojto 100:cbbeb26dbd92 773 */
Kojto 100:cbbeb26dbd92 774
Kojto 100:cbbeb26dbd92 775 /**
Kojto 100:cbbeb26dbd92 776 * @}
Kojto 100:cbbeb26dbd92 777 */
Kojto 100:cbbeb26dbd92 778
Kojto 100:cbbeb26dbd92 779 /**
Kojto 100:cbbeb26dbd92 780 * @}
Kojto 100:cbbeb26dbd92 781 */
Kojto 100:cbbeb26dbd92 782
Kojto 100:cbbeb26dbd92 783 /**
Kojto 100:cbbeb26dbd92 784 * @}
Kojto 100:cbbeb26dbd92 785 */
Kojto 100:cbbeb26dbd92 786 #endif /* STM32F302xE || STM32F303xE || */
Kojto 100:cbbeb26dbd92 787 /* STM32F302xC || STM32F303xC || */
Kojto 100:cbbeb26dbd92 788 /* STM32F302x8 || */
Kojto 100:cbbeb26dbd92 789 /* STM32F373xC */
Kojto 100:cbbeb26dbd92 790
Kojto 100:cbbeb26dbd92 791 #ifdef __cplusplus
Kojto 100:cbbeb26dbd92 792 }
Kojto 100:cbbeb26dbd92 793 #endif
Kojto 100:cbbeb26dbd92 794
Kojto 100:cbbeb26dbd92 795
Kojto 100:cbbeb26dbd92 796 #endif /* __STM32F3xx_HAL_PCD_H */
Kojto 100:cbbeb26dbd92 797
Kojto 100:cbbeb26dbd92 798 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/