The official mbed C/C SDK provides the software platform and libraries to build your applications.

Fork of mbed by mbed official

Committer:
Mikchel
Date:
Sun May 03 16:04:42 2015 +0000
Revision:
99:7f6c6de930c0
Parent:
96:487b796308b0
12

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 96:487b796308b0 1 /**
Kojto 96:487b796308b0 2 ******************************************************************************
Kojto 96:487b796308b0 3 * @file stm32f1xx_ll_usb.h
Kojto 96:487b796308b0 4 * @author MCD Application Team
Kojto 96:487b796308b0 5 * @version V1.0.0
Kojto 96:487b796308b0 6 * @date 15-December-2014
Kojto 96:487b796308b0 7 * @brief Header file of USB Low Layer HAL module.
Kojto 96:487b796308b0 8 ******************************************************************************
Kojto 96:487b796308b0 9 * @attention
Kojto 96:487b796308b0 10 *
Kojto 96:487b796308b0 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 96:487b796308b0 12 *
Kojto 96:487b796308b0 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 96:487b796308b0 14 * are permitted provided that the following conditions are met:
Kojto 96:487b796308b0 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 96:487b796308b0 16 * this list of conditions and the following disclaimer.
Kojto 96:487b796308b0 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 96:487b796308b0 18 * this list of conditions and the following disclaimer in the documentation
Kojto 96:487b796308b0 19 * and/or other materials provided with the distribution.
Kojto 96:487b796308b0 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 96:487b796308b0 21 * may be used to endorse or promote products derived from this software
Kojto 96:487b796308b0 22 * without specific prior written permission.
Kojto 96:487b796308b0 23 *
Kojto 96:487b796308b0 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 96:487b796308b0 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 96:487b796308b0 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 96:487b796308b0 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 96:487b796308b0 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 96:487b796308b0 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 96:487b796308b0 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 96:487b796308b0 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 96:487b796308b0 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 96:487b796308b0 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 96:487b796308b0 34 *
Kojto 96:487b796308b0 35 ******************************************************************************
Kojto 96:487b796308b0 36 */
Kojto 96:487b796308b0 37
Kojto 96:487b796308b0 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 96:487b796308b0 39 #ifndef __STM32F1xx_LL_USB_H
Kojto 96:487b796308b0 40 #define __STM32F1xx_LL_USB_H
Kojto 96:487b796308b0 41
Kojto 96:487b796308b0 42 #ifdef __cplusplus
Kojto 96:487b796308b0 43 extern "C" {
Kojto 96:487b796308b0 44 #endif
Kojto 96:487b796308b0 45
Kojto 96:487b796308b0 46 #if defined(STM32F102x6) || defined(STM32F102xB) || \
Kojto 96:487b796308b0 47 defined(STM32F103x6) || defined(STM32F103xB) || \
Kojto 96:487b796308b0 48 defined(STM32F103xE) || defined(STM32F103xG) || \
Kojto 96:487b796308b0 49 defined(STM32F105xC) || defined(STM32F107xC)
Kojto 96:487b796308b0 50
Kojto 96:487b796308b0 51 /* Includes ------------------------------------------------------------------*/
Kojto 96:487b796308b0 52 #include "stm32f1xx_hal_def.h"
Kojto 96:487b796308b0 53
Kojto 96:487b796308b0 54 /** @addtogroup STM32F1xx_HAL_Driver
Kojto 96:487b796308b0 55 * @{
Kojto 96:487b796308b0 56 */
Kojto 96:487b796308b0 57
Kojto 96:487b796308b0 58 /** @addtogroup USB_LL
Kojto 96:487b796308b0 59 * @{
Kojto 96:487b796308b0 60 */
Kojto 96:487b796308b0 61
Kojto 96:487b796308b0 62 /* Exported types ------------------------------------------------------------*/
Kojto 96:487b796308b0 63 /** @defgroup USB_LL_Exported_Types USB Low Layer Exported Types
Kojto 96:487b796308b0 64 * @{
Kojto 96:487b796308b0 65 */
Kojto 96:487b796308b0 66 /**
Kojto 96:487b796308b0 67 * @brief USB Mode definition
Kojto 96:487b796308b0 68 */
Kojto 96:487b796308b0 69 typedef enum
Kojto 96:487b796308b0 70 {
Kojto 96:487b796308b0 71 USB_DEVICE_MODE = 0,
Kojto 96:487b796308b0 72 USB_HOST_MODE = 1,
Kojto 96:487b796308b0 73 USB_DRD_MODE = 2
Kojto 96:487b796308b0 74 }USB_ModeTypeDef;
Kojto 96:487b796308b0 75
Kojto 96:487b796308b0 76 #if defined (USB_OTG_FS)
Kojto 96:487b796308b0 77 /**
Kojto 96:487b796308b0 78 * @brief URB States definition
Kojto 96:487b796308b0 79 */
Kojto 96:487b796308b0 80 typedef enum {
Kojto 96:487b796308b0 81 URB_IDLE = 0,
Kojto 96:487b796308b0 82 URB_DONE,
Kojto 96:487b796308b0 83 URB_NOTREADY,
Kojto 96:487b796308b0 84 URB_NYET,
Kojto 96:487b796308b0 85 URB_ERROR,
Kojto 96:487b796308b0 86 URB_STALL
Kojto 96:487b796308b0 87 }USB_OTG_URBStateTypeDef;
Kojto 96:487b796308b0 88
Kojto 96:487b796308b0 89 /**
Kojto 96:487b796308b0 90 * @brief Host channel States definition
Kojto 96:487b796308b0 91 */
Kojto 96:487b796308b0 92 typedef enum {
Kojto 96:487b796308b0 93 HC_IDLE = 0,
Kojto 96:487b796308b0 94 HC_XFRC,
Kojto 96:487b796308b0 95 HC_HALTED,
Kojto 96:487b796308b0 96 HC_NAK,
Kojto 96:487b796308b0 97 HC_NYET,
Kojto 96:487b796308b0 98 HC_STALL,
Kojto 96:487b796308b0 99 HC_XACTERR,
Kojto 96:487b796308b0 100 HC_BBLERR,
Kojto 96:487b796308b0 101 HC_DATATGLERR
Kojto 96:487b796308b0 102 }USB_OTG_HCStateTypeDef;
Kojto 96:487b796308b0 103
Kojto 96:487b796308b0 104 /**
Kojto 96:487b796308b0 105 * @brief USB OTG Initialization Structure definition
Kojto 96:487b796308b0 106 */
Kojto 96:487b796308b0 107 typedef struct
Kojto 96:487b796308b0 108 {
Kojto 96:487b796308b0 109 uint32_t dev_endpoints; /*!< Device Endpoints number.
Kojto 96:487b796308b0 110 This parameter depends on the used USB core.
Kojto 96:487b796308b0 111 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 112
Kojto 96:487b796308b0 113 uint32_t Host_channels; /*!< Host Channels number.
Kojto 96:487b796308b0 114 This parameter Depends on the used USB core.
Kojto 96:487b796308b0 115 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 116
Kojto 96:487b796308b0 117 uint32_t speed; /*!< USB Core speed.
Kojto 96:487b796308b0 118 This parameter can be any value of @ref USB_Core_Speed_ */
Kojto 96:487b796308b0 119
Kojto 96:487b796308b0 120 uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size.
Kojto 96:487b796308b0 121 This parameter can be any value of @ref USB_EP0_MPS_ */
Kojto 96:487b796308b0 122
Kojto 96:487b796308b0 123 uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
Kojto 96:487b796308b0 124
Kojto 96:487b796308b0 125 uint32_t low_power_enable; /*!< Enable or disable the low power mode. */
Kojto 96:487b796308b0 126
Kojto 96:487b796308b0 127 uint32_t vbus_sensing_enable; /*!< Enable or disable the VBUS Sensing feature. */
Kojto 96:487b796308b0 128
Kojto 96:487b796308b0 129 uint32_t use_external_vbus; /*!< Enable or disable the use of the external VBUS. */
Kojto 96:487b796308b0 130 }USB_OTG_CfgTypeDef;
Kojto 96:487b796308b0 131
Kojto 96:487b796308b0 132 typedef struct
Kojto 96:487b796308b0 133 {
Kojto 96:487b796308b0 134 uint8_t num; /*!< Endpoint number
Kojto 96:487b796308b0 135 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 136
Kojto 96:487b796308b0 137 uint8_t is_in; /*!< Endpoint direction
Kojto 96:487b796308b0 138 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 139
Kojto 96:487b796308b0 140 uint8_t is_stall; /*!< Endpoint stall condition
Kojto 96:487b796308b0 141 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 142
Kojto 96:487b796308b0 143 uint8_t type; /*!< Endpoint type
Kojto 96:487b796308b0 144 This parameter can be any value of @ref USB_EP_Type_ */
Kojto 96:487b796308b0 145
Kojto 96:487b796308b0 146 uint8_t data_pid_start; /*!< Initial data PID
Kojto 96:487b796308b0 147 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 148
Kojto 96:487b796308b0 149 uint8_t even_odd_frame; /*!< IFrame parity
Kojto 96:487b796308b0 150 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 151
Kojto 96:487b796308b0 152 uint16_t tx_fifo_num; /*!< Transmission FIFO number
Kojto 96:487b796308b0 153 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 154
Kojto 96:487b796308b0 155 uint32_t maxpacket; /*!< Endpoint Max packet size
Kojto 96:487b796308b0 156 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
Kojto 96:487b796308b0 157
Kojto 96:487b796308b0 158 uint8_t *xfer_buff; /*!< Pointer to transfer buffer */
Kojto 96:487b796308b0 159
Kojto 96:487b796308b0 160 uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address */
Kojto 96:487b796308b0 161
Kojto 96:487b796308b0 162 uint32_t xfer_len; /*!< Current transfer length */
Kojto 96:487b796308b0 163
Kojto 96:487b796308b0 164 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer */
Kojto 96:487b796308b0 165 }USB_OTG_EPTypeDef;
Kojto 96:487b796308b0 166
Kojto 96:487b796308b0 167 typedef struct
Kojto 96:487b796308b0 168 {
Kojto 96:487b796308b0 169 uint8_t dev_addr ; /*!< USB device address.
Kojto 96:487b796308b0 170 This parameter must be a number between Min_Data = 1 and Max_Data = 255 */
Kojto 96:487b796308b0 171
Kojto 96:487b796308b0 172 uint8_t ch_num; /*!< Host channel number.
Kojto 96:487b796308b0 173 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 174
Kojto 96:487b796308b0 175 uint8_t ep_num; /*!< Endpoint number.
Kojto 96:487b796308b0 176 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 177
Kojto 96:487b796308b0 178 uint8_t ep_is_in; /*!< Endpoint direction
Kojto 96:487b796308b0 179 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 180
Kojto 96:487b796308b0 181 uint8_t speed; /*!< USB Host speed.
Kojto 96:487b796308b0 182 This parameter can be any value of @ref USB_Core_Speed_ */
Kojto 96:487b796308b0 183
Kojto 96:487b796308b0 184 uint8_t do_ping; /*!< Enable or disable the use of the PING protocol for HS mode. */
Kojto 96:487b796308b0 185
Kojto 96:487b796308b0 186 uint8_t process_ping; /*!< Execute the PING protocol for HS mode. */
Kojto 96:487b796308b0 187
Kojto 96:487b796308b0 188 uint8_t ep_type; /*!< Endpoint Type.
Kojto 96:487b796308b0 189 This parameter can be any value of @ref USB_EP_Type_ */
Kojto 96:487b796308b0 190
Kojto 96:487b796308b0 191 uint16_t max_packet; /*!< Endpoint Max packet size.
Kojto 96:487b796308b0 192 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
Kojto 96:487b796308b0 193
Kojto 96:487b796308b0 194 uint8_t data_pid; /*!< Initial data PID.
Kojto 96:487b796308b0 195 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 196
Kojto 96:487b796308b0 197 uint8_t *xfer_buff; /*!< Pointer to transfer buffer. */
Kojto 96:487b796308b0 198
Kojto 96:487b796308b0 199 uint32_t xfer_len; /*!< Current transfer length. */
Kojto 96:487b796308b0 200
Kojto 96:487b796308b0 201 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer. */
Kojto 96:487b796308b0 202
Kojto 96:487b796308b0 203 uint8_t toggle_in; /*!< IN transfer current toggle flag.
Kojto 96:487b796308b0 204 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 205
Kojto 96:487b796308b0 206 uint8_t toggle_out; /*!< OUT transfer current toggle flag
Kojto 96:487b796308b0 207 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 208
Kojto 96:487b796308b0 209 uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address. */
Kojto 96:487b796308b0 210
Kojto 96:487b796308b0 211 uint32_t ErrCnt; /*!< Host channel error count.*/
Kojto 96:487b796308b0 212
Kojto 96:487b796308b0 213 USB_OTG_URBStateTypeDef urb_state; /*!< URB state.
Kojto 96:487b796308b0 214 This parameter can be any value of @ref USB_OTG_URBStateTypeDef */
Kojto 96:487b796308b0 215
Kojto 96:487b796308b0 216 USB_OTG_HCStateTypeDef state; /*!< Host Channel state.
Kojto 96:487b796308b0 217 This parameter can be any value of @ref USB_OTG_HCStateTypeDef */
Kojto 96:487b796308b0 218 }USB_OTG_HCTypeDef;
Kojto 96:487b796308b0 219 #endif /* USB_OTG_FS */
Kojto 96:487b796308b0 220
Kojto 96:487b796308b0 221 #if defined (USB)
Kojto 96:487b796308b0 222 /**
Kojto 96:487b796308b0 223 * @brief USB Initialization Structure definition
Kojto 96:487b796308b0 224 */
Kojto 96:487b796308b0 225 typedef struct
Kojto 96:487b796308b0 226 {
Kojto 96:487b796308b0 227 uint32_t dev_endpoints; /*!< Device Endpoints number.
Kojto 96:487b796308b0 228 This parameter depends on the used USB core.
Kojto 96:487b796308b0 229 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 230
Kojto 96:487b796308b0 231 uint32_t speed; /*!< USB Core speed.
Kojto 96:487b796308b0 232 This parameter can be any value of @ref USB_Core_Speed */
Kojto 96:487b796308b0 233
Kojto 96:487b796308b0 234 uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size.
Kojto 96:487b796308b0 235 This parameter can be any value of @ref USB_EP0_MPS */
Kojto 96:487b796308b0 236
Kojto 96:487b796308b0 237 uint32_t phy_itface; /*!< Select the used PHY interface.
Kojto 96:487b796308b0 238 This parameter can be any value of @ref USB_Core_PHY */
Kojto 96:487b796308b0 239
Kojto 96:487b796308b0 240 uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
Kojto 96:487b796308b0 241
Kojto 96:487b796308b0 242 uint32_t low_power_enable; /*!< Enable or disable Low Power mode */
Kojto 96:487b796308b0 243
Kojto 96:487b796308b0 244 uint32_t lpm_enable; /*!< Enable or disable Battery charging. */
Kojto 96:487b796308b0 245
Kojto 96:487b796308b0 246 uint32_t battery_charging_enable; /*!< Enable or disable Battery charging. */
Kojto 96:487b796308b0 247 } USB_CfgTypeDef;
Kojto 96:487b796308b0 248
Kojto 96:487b796308b0 249 typedef struct
Kojto 96:487b796308b0 250 {
Kojto 96:487b796308b0 251 uint8_t num; /*!< Endpoint number
Kojto 96:487b796308b0 252 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
Kojto 96:487b796308b0 253
Kojto 96:487b796308b0 254 uint8_t is_in; /*!< Endpoint direction
Kojto 96:487b796308b0 255 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 256
Kojto 96:487b796308b0 257 uint8_t is_stall; /*!< Endpoint stall condition
Kojto 96:487b796308b0 258 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
Kojto 96:487b796308b0 259
Kojto 96:487b796308b0 260 uint8_t type; /*!< Endpoint type
Kojto 96:487b796308b0 261 This parameter can be any value of @ref USB_EP_Type */
Kojto 96:487b796308b0 262
Kojto 96:487b796308b0 263 uint16_t pmaadress; /*!< PMA Address
Kojto 96:487b796308b0 264 This parameter can be any value between Min_addr = 0 and Max_addr = 1K */
Kojto 96:487b796308b0 265
Kojto 96:487b796308b0 266 uint16_t pmaaddr0; /*!< PMA Address0
Kojto 96:487b796308b0 267 This parameter can be any value between Min_addr = 0 and Max_addr = 1K */
Kojto 96:487b796308b0 268
Kojto 96:487b796308b0 269 uint16_t pmaaddr1; /*!< PMA Address1
Kojto 96:487b796308b0 270 This parameter can be any value between Min_addr = 0 and Max_addr = 1K */
Kojto 96:487b796308b0 271
Kojto 96:487b796308b0 272 uint8_t doublebuffer; /*!< Double buffer enable
Kojto 96:487b796308b0 273 This parameter can be 0 or 1 */
Kojto 96:487b796308b0 274
Kojto 96:487b796308b0 275 uint16_t tx_fifo_num; /*!< This parameter is not required by USB Device FS peripheral, it is used
Kojto 96:487b796308b0 276 only by USB OTG FS peripheral
Kojto 96:487b796308b0 277 This parameter is added to ensure compatibility across USB peripherals */
Kojto 96:487b796308b0 278
Kojto 96:487b796308b0 279 uint32_t maxpacket; /*!< Endpoint Max packet size
Kojto 96:487b796308b0 280 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
Kojto 96:487b796308b0 281
Kojto 96:487b796308b0 282 uint8_t *xfer_buff; /*!< Pointer to transfer buffer */
Kojto 96:487b796308b0 283
Kojto 96:487b796308b0 284 uint32_t xfer_len; /*!< Current transfer length */
Kojto 96:487b796308b0 285
Kojto 96:487b796308b0 286 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer */
Kojto 96:487b796308b0 287
Kojto 96:487b796308b0 288 } USB_EPTypeDef;
Kojto 96:487b796308b0 289 #endif /* USB */
Kojto 96:487b796308b0 290 /**
Kojto 96:487b796308b0 291 * @}
Kojto 96:487b796308b0 292 */
Kojto 96:487b796308b0 293
Kojto 96:487b796308b0 294 /* Exported constants --------------------------------------------------------*/
Kojto 96:487b796308b0 295 /** @defgroup USB_LL_Exported_Constants USB Low Layer Exported Constants
Kojto 96:487b796308b0 296 * @{
Kojto 96:487b796308b0 297 */
Kojto 96:487b796308b0 298 #if defined (USB_OTG_FS)
Kojto 96:487b796308b0 299 /** @defgroup USB_LL_Core_Mode USB Low Layer Core Mode
Kojto 96:487b796308b0 300 * @{
Kojto 96:487b796308b0 301 */
Kojto 96:487b796308b0 302 #define USB_OTG_MODE_DEVICE 0
Kojto 96:487b796308b0 303 #define USB_OTG_MODE_HOST 1
Kojto 96:487b796308b0 304 #define USB_OTG_MODE_DRD 2
Kojto 96:487b796308b0 305 /**
Kojto 96:487b796308b0 306 * @}
Kojto 96:487b796308b0 307 */
Kojto 96:487b796308b0 308
Kojto 96:487b796308b0 309 /** @defgroup USB_LL_Core_Speed USB Low Layer Core Speed
Kojto 96:487b796308b0 310 * @{
Kojto 96:487b796308b0 311 */
Kojto 96:487b796308b0 312 #define USB_OTG_SPEED_LOW 2
Kojto 96:487b796308b0 313 #define USB_OTG_SPEED_FULL 3
Kojto 96:487b796308b0 314
Kojto 96:487b796308b0 315 /**
Kojto 96:487b796308b0 316 * @}
Kojto 96:487b796308b0 317 */
Kojto 96:487b796308b0 318
Kojto 96:487b796308b0 319 /** @defgroup USB_LL_Core_PHY USB Low Layer Core PHY
Kojto 96:487b796308b0 320 * @{
Kojto 96:487b796308b0 321 */
Kojto 96:487b796308b0 322 #define USB_OTG_ULPI_PHY 1
Kojto 96:487b796308b0 323 #define USB_OTG_EMBEDDED_PHY 2
Kojto 96:487b796308b0 324 /**
Kojto 96:487b796308b0 325 * @}
Kojto 96:487b796308b0 326 */
Kojto 96:487b796308b0 327
Kojto 96:487b796308b0 328 /** @defgroup USB_LL_Core_MPS USB Low Layer Core MPS
Kojto 96:487b796308b0 329 * @{
Kojto 96:487b796308b0 330 */
Kojto 96:487b796308b0 331 #define USB_OTG_FS_MAX_PACKET_SIZE 64
Kojto 96:487b796308b0 332 #define USB_OTG_MAX_EP0_SIZE 64
Kojto 96:487b796308b0 333 /**
Kojto 96:487b796308b0 334 * @}
Kojto 96:487b796308b0 335 */
Kojto 96:487b796308b0 336
Kojto 96:487b796308b0 337 /** @defgroup USB_LL_Core_PHY_Frequency USB Low Layer Core PHY Frequency
Kojto 96:487b796308b0 338 * @{
Kojto 96:487b796308b0 339 */
Kojto 96:487b796308b0 340 #define DSTS_ENUMSPD_FS_PHY_30MHZ_OR_60MHZ (1 << 1)
Kojto 96:487b796308b0 341 #define DSTS_ENUMSPD_LS_PHY_6MHZ (2 << 1)
Kojto 96:487b796308b0 342 #define DSTS_ENUMSPD_FS_PHY_48MHZ (3 << 1)
Kojto 96:487b796308b0 343 /**
Kojto 96:487b796308b0 344 * @}
Kojto 96:487b796308b0 345 */
Kojto 96:487b796308b0 346
Kojto 96:487b796308b0 347 /** @defgroup USB_LL_CORE_Frame_Interval USB Low Layer Core Frame Interval
Kojto 96:487b796308b0 348 * @{
Kojto 96:487b796308b0 349 */
Kojto 96:487b796308b0 350 #define DCFG_FRAME_INTERVAL_80 0
Kojto 96:487b796308b0 351 #define DCFG_FRAME_INTERVAL_85 1
Kojto 96:487b796308b0 352 #define DCFG_FRAME_INTERVAL_90 2
Kojto 96:487b796308b0 353 #define DCFG_FRAME_INTERVAL_95 3
Kojto 96:487b796308b0 354 /**
Kojto 96:487b796308b0 355 * @}
Kojto 96:487b796308b0 356 */
Kojto 96:487b796308b0 357
Kojto 96:487b796308b0 358 /** @defgroup USB_LL_EP0_MPS USB Low Layer EP0 MPS
Kojto 96:487b796308b0 359 * @{
Kojto 96:487b796308b0 360 */
Kojto 96:487b796308b0 361 #define DEP0CTL_MPS_64 0
Kojto 96:487b796308b0 362 #define DEP0CTL_MPS_32 1
Kojto 96:487b796308b0 363 #define DEP0CTL_MPS_16 2
Kojto 96:487b796308b0 364 #define DEP0CTL_MPS_8 3
Kojto 96:487b796308b0 365 /**
Kojto 96:487b796308b0 366 * @}
Kojto 96:487b796308b0 367 */
Kojto 96:487b796308b0 368
Kojto 96:487b796308b0 369 /** @defgroup USB_LL_EP_Speed USB Low Layer EP Speed
Kojto 96:487b796308b0 370 * @{
Kojto 96:487b796308b0 371 */
Kojto 96:487b796308b0 372 #define EP_SPEED_LOW 0
Kojto 96:487b796308b0 373 #define EP_SPEED_FULL 1
Kojto 96:487b796308b0 374 #define EP_SPEED_HIGH 2
Kojto 96:487b796308b0 375 /**
Kojto 96:487b796308b0 376 * @}
Kojto 96:487b796308b0 377 */
Kojto 96:487b796308b0 378
Kojto 96:487b796308b0 379 /** @defgroup USB_LL_EP_Type USB Low Layer EP Type
Kojto 96:487b796308b0 380 * @{
Kojto 96:487b796308b0 381 */
Kojto 96:487b796308b0 382 #define EP_TYPE_CTRL 0
Kojto 96:487b796308b0 383 #define EP_TYPE_ISOC 1
Kojto 96:487b796308b0 384 #define EP_TYPE_BULK 2
Kojto 96:487b796308b0 385 #define EP_TYPE_INTR 3
Kojto 96:487b796308b0 386 #define EP_TYPE_MSK 3
Kojto 96:487b796308b0 387 /**
Kojto 96:487b796308b0 388 * @}
Kojto 96:487b796308b0 389 */
Kojto 96:487b796308b0 390
Kojto 96:487b796308b0 391 /** @defgroup USB_LL_STS_Defines USB Low Layer STS Defines
Kojto 96:487b796308b0 392 * @{
Kojto 96:487b796308b0 393 */
Kojto 96:487b796308b0 394 #define STS_GOUT_NAK 1
Kojto 96:487b796308b0 395 #define STS_DATA_UPDT 2
Kojto 96:487b796308b0 396 #define STS_XFER_COMP 3
Kojto 96:487b796308b0 397 #define STS_SETUP_COMP 4
Kojto 96:487b796308b0 398 #define STS_SETUP_UPDT 6
Kojto 96:487b796308b0 399 /**
Kojto 96:487b796308b0 400 * @}
Kojto 96:487b796308b0 401 */
Kojto 96:487b796308b0 402
Kojto 96:487b796308b0 403 /** @defgroup USB_LL_HCFG_SPEED_Defines USB Low Layer HCFG Speed Defines
Kojto 96:487b796308b0 404 * @{
Kojto 96:487b796308b0 405 */
Kojto 96:487b796308b0 406 #define HCFG_30_60_MHZ 0
Kojto 96:487b796308b0 407 #define HCFG_48_MHZ 1
Kojto 96:487b796308b0 408 #define HCFG_6_MHZ 2
Kojto 96:487b796308b0 409 /**
Kojto 96:487b796308b0 410 * @}
Kojto 96:487b796308b0 411 */
Kojto 96:487b796308b0 412
Kojto 96:487b796308b0 413 /** @defgroup USB_LL_HPRT0_PRTSPD_SPEED_Defines USB Low Layer HPRT0 PRTSPD Speed Defines
Kojto 96:487b796308b0 414 * @{
Kojto 96:487b796308b0 415 */
Kojto 96:487b796308b0 416 #define HPRT0_PRTSPD_HIGH_SPEED 0
Kojto 96:487b796308b0 417 #define HPRT0_PRTSPD_FULL_SPEED 1
Kojto 96:487b796308b0 418 #define HPRT0_PRTSPD_LOW_SPEED 2
Kojto 96:487b796308b0 419 /**
Kojto 96:487b796308b0 420 * @}
Kojto 96:487b796308b0 421 */
Kojto 96:487b796308b0 422
Kojto 96:487b796308b0 423 #define HCCHAR_CTRL 0
Kojto 96:487b796308b0 424 #define HCCHAR_ISOC 1
Kojto 96:487b796308b0 425 #define HCCHAR_BULK 2
Kojto 96:487b796308b0 426 #define HCCHAR_INTR 3
Kojto 96:487b796308b0 427
Kojto 96:487b796308b0 428 #define HC_PID_DATA0 0
Kojto 96:487b796308b0 429 #define HC_PID_DATA2 1
Kojto 96:487b796308b0 430 #define HC_PID_DATA1 2
Kojto 96:487b796308b0 431 #define HC_PID_SETUP 3
Kojto 96:487b796308b0 432
Kojto 96:487b796308b0 433 #define GRXSTS_PKTSTS_IN 2
Kojto 96:487b796308b0 434 #define GRXSTS_PKTSTS_IN_XFER_COMP 3
Kojto 96:487b796308b0 435 #define GRXSTS_PKTSTS_DATA_TOGGLE_ERR 5
Kojto 96:487b796308b0 436 #define GRXSTS_PKTSTS_CH_HALTED 7
Kojto 96:487b796308b0 437
Kojto 96:487b796308b0 438 #define USBx_PCGCCTL *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_PCGCCTL_BASE)
Kojto 96:487b796308b0 439 #define USBx_HPRT0 *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_HOST_PORT_BASE)
Kojto 96:487b796308b0 440
Kojto 96:487b796308b0 441 #define USBx_DEVICE ((USB_OTG_DeviceTypeDef *)((uint32_t )USBx + USB_OTG_DEVICE_BASE))
Kojto 96:487b796308b0 442 #define USBx_INEP(i) ((USB_OTG_INEndpointTypeDef *)((uint32_t)USBx + USB_OTG_IN_ENDPOINT_BASE + (i)*USB_OTG_EP_REG_SIZE))
Kojto 96:487b796308b0 443 #define USBx_OUTEP(i) ((USB_OTG_OUTEndpointTypeDef *)((uint32_t)USBx + USB_OTG_OUT_ENDPOINT_BASE + (i)*USB_OTG_EP_REG_SIZE))
Kojto 96:487b796308b0 444 #define USBx_DFIFO(i) *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_FIFO_BASE + (i) * USB_OTG_FIFO_SIZE)
Kojto 96:487b796308b0 445
Kojto 96:487b796308b0 446 #define USBx_HOST ((USB_OTG_HostTypeDef *)((uint32_t )USBx + USB_OTG_HOST_BASE))
Kojto 96:487b796308b0 447 #define USBx_HC(i) ((USB_OTG_HostChannelTypeDef *)((uint32_t)USBx + USB_OTG_HOST_CHANNEL_BASE + (i)*USB_OTG_HOST_CHANNEL_SIZE))
Kojto 96:487b796308b0 448 #endif /* USB_OTG_FS */
Kojto 96:487b796308b0 449
Kojto 96:487b796308b0 450 #if defined (USB)
Kojto 96:487b796308b0 451 /** @defgroup USB_LL_EP0_MPS USB Low Layer EP0 MPS
Kojto 96:487b796308b0 452 * @{
Kojto 96:487b796308b0 453 */
Kojto 96:487b796308b0 454 #define DEP0CTL_MPS_64 0
Kojto 96:487b796308b0 455 #define DEP0CTL_MPS_32 1
Kojto 96:487b796308b0 456 #define DEP0CTL_MPS_16 2
Kojto 96:487b796308b0 457 #define DEP0CTL_MPS_8 3
Kojto 96:487b796308b0 458 /**
Kojto 96:487b796308b0 459 * @}
Kojto 96:487b796308b0 460 */
Kojto 96:487b796308b0 461
Kojto 96:487b796308b0 462 /** @defgroup USB_LL_EP_Type USB Low Layer EP Type
Kojto 96:487b796308b0 463 * @{
Kojto 96:487b796308b0 464 */
Kojto 96:487b796308b0 465 #define EP_TYPE_CTRL 0
Kojto 96:487b796308b0 466 #define EP_TYPE_ISOC 1
Kojto 96:487b796308b0 467 #define EP_TYPE_BULK 2
Kojto 96:487b796308b0 468 #define EP_TYPE_INTR 3
Kojto 96:487b796308b0 469 #define EP_TYPE_MSK 3
Kojto 96:487b796308b0 470 /**
Kojto 96:487b796308b0 471 * @}
Kojto 96:487b796308b0 472 */
Kojto 96:487b796308b0 473
Kojto 96:487b796308b0 474 #define BTABLE_ADDRESS (0x000)
Kojto 96:487b796308b0 475 #endif /* USB */
Kojto 96:487b796308b0 476 /**
Kojto 96:487b796308b0 477 * @}
Kojto 96:487b796308b0 478 */
Kojto 96:487b796308b0 479
Kojto 96:487b796308b0 480 /* Exported macros -----------------------------------------------------------*/
Kojto 96:487b796308b0 481 /** @defgroup USB_LL_Exported_Macros USB Low Layer Exported Macros
Kojto 96:487b796308b0 482 * @{
Kojto 96:487b796308b0 483 */
Kojto 96:487b796308b0 484 #if defined (USB_OTG_FS)
Kojto 96:487b796308b0 485 #define USB_MASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK &= ~(__INTERRUPT__))
Kojto 96:487b796308b0 486 #define USB_UNMASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK |= (__INTERRUPT__))
Kojto 96:487b796308b0 487
Kojto 96:487b796308b0 488 #define CLEAR_IN_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_INEP(__EPNUM__)->DIEPINT = (__INTERRUPT__))
Kojto 96:487b796308b0 489 #define CLEAR_OUT_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_OUTEP(__EPNUM__)->DOEPINT = (__INTERRUPT__))
Kojto 96:487b796308b0 490 #endif /* USB_OTG_FS */
Kojto 96:487b796308b0 491 /**
Kojto 96:487b796308b0 492 * @}
Kojto 96:487b796308b0 493 */
Kojto 96:487b796308b0 494
Kojto 96:487b796308b0 495 /* Exported functions --------------------------------------------------------*/
Kojto 96:487b796308b0 496 /** @addtogroup USB_LL_Exported_Functions USB Low Layer Exported Functions
Kojto 96:487b796308b0 497 * @{
Kojto 96:487b796308b0 498 */
Kojto 96:487b796308b0 499 /** @addtogroup USB_LL_Exported_Functions_Group1 Peripheral Control functions
Kojto 96:487b796308b0 500 * @{
Kojto 96:487b796308b0 501 */
Kojto 96:487b796308b0 502 #if defined (USB_OTG_FS)
Kojto 96:487b796308b0 503 HAL_StatusTypeDef USB_CoreInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
Kojto 96:487b796308b0 504 HAL_StatusTypeDef USB_DevInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
Kojto 96:487b796308b0 505 HAL_StatusTypeDef USB_EnableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 506 HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 507 HAL_StatusTypeDef USB_SetCurrentMode(USB_OTG_GlobalTypeDef *USBx , USB_ModeTypeDef mode);
Kojto 96:487b796308b0 508 HAL_StatusTypeDef USB_SetDevSpeed(USB_OTG_GlobalTypeDef *USBx , uint8_t speed);
Kojto 96:487b796308b0 509 HAL_StatusTypeDef USB_FlushRxFifo (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 510 HAL_StatusTypeDef USB_FlushTxFifo (USB_OTG_GlobalTypeDef *USBx, uint32_t num );
Kojto 96:487b796308b0 511 HAL_StatusTypeDef USB_ActivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
Kojto 96:487b796308b0 512 HAL_StatusTypeDef USB_DeactivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
Kojto 96:487b796308b0 513 HAL_StatusTypeDef USB_EPStartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
Kojto 96:487b796308b0 514 HAL_StatusTypeDef USB_EP0StartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
Kojto 96:487b796308b0 515 HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len);
Kojto 96:487b796308b0 516 void * USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len);
Kojto 96:487b796308b0 517 HAL_StatusTypeDef USB_EPSetStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
Kojto 96:487b796308b0 518 HAL_StatusTypeDef USB_EPClearStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
Kojto 96:487b796308b0 519 HAL_StatusTypeDef USB_SetDevAddress (USB_OTG_GlobalTypeDef *USBx, uint8_t address);
Kojto 96:487b796308b0 520 HAL_StatusTypeDef USB_DevConnect (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 521 HAL_StatusTypeDef USB_DevDisconnect (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 522 HAL_StatusTypeDef USB_StopDevice(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 523 HAL_StatusTypeDef USB_ActivateSetup (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 524 HAL_StatusTypeDef USB_EP0_OutStart(USB_OTG_GlobalTypeDef *USBx, uint8_t *psetup);
Kojto 96:487b796308b0 525 uint8_t USB_GetDevSpeed(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 526 uint32_t USB_GetMode(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 527 uint32_t USB_ReadInterrupts (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 528 uint32_t USB_ReadDevAllOutEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 529 uint32_t USB_ReadDevOutEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
Kojto 96:487b796308b0 530 uint32_t USB_ReadDevAllInEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 531 uint32_t USB_ReadDevInEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
Kojto 96:487b796308b0 532 void USB_ClearInterrupts (USB_OTG_GlobalTypeDef *USBx, uint32_t interrupt);
Kojto 96:487b796308b0 533
Kojto 96:487b796308b0 534 HAL_StatusTypeDef USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg);
Kojto 96:487b796308b0 535 HAL_StatusTypeDef USB_InitFSLSPClkSel(USB_OTG_GlobalTypeDef *USBx , uint8_t freq);
Kojto 96:487b796308b0 536 HAL_StatusTypeDef USB_ResetPort(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 537 HAL_StatusTypeDef USB_DriveVbus (USB_OTG_GlobalTypeDef *USBx, uint8_t state);
Kojto 96:487b796308b0 538 uint32_t USB_GetHostSpeed (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 539 uint32_t USB_GetCurrentFrame (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 540 HAL_StatusTypeDef USB_HC_Init(USB_OTG_GlobalTypeDef *USBx,
Kojto 96:487b796308b0 541 uint8_t ch_num,
Kojto 96:487b796308b0 542 uint8_t epnum,
Kojto 96:487b796308b0 543 uint8_t dev_address,
Kojto 96:487b796308b0 544 uint8_t speed,
Kojto 96:487b796308b0 545 uint8_t ep_type,
Kojto 96:487b796308b0 546 uint16_t mps);
Kojto 96:487b796308b0 547 HAL_StatusTypeDef USB_HC_StartXfer(USB_OTG_GlobalTypeDef *USBx, USB_OTG_HCTypeDef *hc);
Kojto 96:487b796308b0 548 uint32_t USB_HC_ReadInterrupt (USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 549 HAL_StatusTypeDef USB_HC_Halt(USB_OTG_GlobalTypeDef *USBx , uint8_t hc_num);
Kojto 96:487b796308b0 550 HAL_StatusTypeDef USB_DoPing(USB_OTG_GlobalTypeDef *USBx , uint8_t ch_num);
Kojto 96:487b796308b0 551 HAL_StatusTypeDef USB_StopHost(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 552 HAL_StatusTypeDef USB_ActivateRemoteWakeup(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 553 HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_OTG_GlobalTypeDef *USBx);
Kojto 96:487b796308b0 554 #endif /* USB_OTG_FS */
Kojto 96:487b796308b0 555
Kojto 96:487b796308b0 556 #if defined (USB)
Kojto 96:487b796308b0 557 HAL_StatusTypeDef USB_CoreInit(USB_TypeDef *USBx, USB_CfgTypeDef Init);
Kojto 96:487b796308b0 558 HAL_StatusTypeDef USB_DevInit(USB_TypeDef *USBx, USB_CfgTypeDef Init);
Kojto 96:487b796308b0 559 HAL_StatusTypeDef USB_EnableGlobalInt(USB_TypeDef *USBx);
Kojto 96:487b796308b0 560 HAL_StatusTypeDef USB_DisableGlobalInt(USB_TypeDef *USBx);
Kojto 96:487b796308b0 561 HAL_StatusTypeDef USB_SetCurrentMode(USB_TypeDef *USBx , USB_ModeTypeDef mode);
Kojto 96:487b796308b0 562 HAL_StatusTypeDef USB_SetDevSpeed(USB_TypeDef *USBx , uint8_t speed);
Kojto 96:487b796308b0 563 HAL_StatusTypeDef USB_FlushRxFifo (USB_TypeDef *USBx);
Kojto 96:487b796308b0 564 HAL_StatusTypeDef USB_FlushTxFifo (USB_TypeDef *USBx, uint32_t num );
Kojto 96:487b796308b0 565 HAL_StatusTypeDef USB_ActivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep);
Kojto 96:487b796308b0 566 HAL_StatusTypeDef USB_DeactivateEndpoint(USB_TypeDef *USBx, USB_EPTypeDef *ep);
Kojto 96:487b796308b0 567 HAL_StatusTypeDef USB_EPStartXfer(USB_TypeDef *USBx , USB_EPTypeDef *ep);
Kojto 96:487b796308b0 568 HAL_StatusTypeDef USB_WritePacket(USB_TypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len);
Kojto 96:487b796308b0 569 void * USB_ReadPacket(USB_TypeDef *USBx, uint8_t *dest, uint16_t len);
Kojto 96:487b796308b0 570 HAL_StatusTypeDef USB_EPSetStall(USB_TypeDef *USBx , USB_EPTypeDef *ep);
Kojto 96:487b796308b0 571 HAL_StatusTypeDef USB_EPClearStall(USB_TypeDef *USBx , USB_EPTypeDef *ep);
Kojto 96:487b796308b0 572 HAL_StatusTypeDef USB_SetDevAddress (USB_TypeDef *USBx, uint8_t address);
Kojto 96:487b796308b0 573 HAL_StatusTypeDef USB_DevConnect (USB_TypeDef *USBx);
Kojto 96:487b796308b0 574 HAL_StatusTypeDef USB_DevDisconnect (USB_TypeDef *USBx);
Kojto 96:487b796308b0 575 HAL_StatusTypeDef USB_StopDevice(USB_TypeDef *USBx);
Kojto 96:487b796308b0 576 HAL_StatusTypeDef USB_EP0_OutStart(USB_TypeDef *USBx, uint8_t *psetup);
Kojto 96:487b796308b0 577 uint32_t USB_ReadInterrupts (USB_TypeDef *USBx);
Kojto 96:487b796308b0 578 uint32_t USB_ReadDevAllOutEpInterrupt (USB_TypeDef *USBx);
Kojto 96:487b796308b0 579 uint32_t USB_ReadDevOutEPInterrupt (USB_TypeDef *USBx , uint8_t epnum);
Kojto 96:487b796308b0 580 uint32_t USB_ReadDevAllInEpInterrupt (USB_TypeDef *USBx);
Kojto 96:487b796308b0 581 uint32_t USB_ReadDevInEPInterrupt (USB_TypeDef *USBx , uint8_t epnum);
Kojto 96:487b796308b0 582 void USB_ClearInterrupts (USB_TypeDef *USBx, uint32_t interrupt);
Kojto 96:487b796308b0 583
Kojto 96:487b796308b0 584 HAL_StatusTypeDef USB_ActivateRemoteWakeup(USB_TypeDef *USBx);
Kojto 96:487b796308b0 585 HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_TypeDef *USBx);
Kojto 96:487b796308b0 586 void USB_WritePMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes);
Kojto 96:487b796308b0 587 void USB_ReadPMA(USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes);
Kojto 96:487b796308b0 588 #endif /* USB */
Kojto 96:487b796308b0 589 /**
Kojto 96:487b796308b0 590 * @}
Kojto 96:487b796308b0 591 */
Kojto 96:487b796308b0 592 /**
Kojto 96:487b796308b0 593 * @}
Kojto 96:487b796308b0 594 */
Kojto 96:487b796308b0 595
Kojto 96:487b796308b0 596 /**
Kojto 96:487b796308b0 597 * @}
Kojto 96:487b796308b0 598 */
Kojto 96:487b796308b0 599
Kojto 96:487b796308b0 600 /**
Kojto 96:487b796308b0 601 * @}
Kojto 96:487b796308b0 602 */
Kojto 96:487b796308b0 603
Kojto 96:487b796308b0 604 #endif /* STM32F102x6 || STM32F102xB || */
Kojto 96:487b796308b0 605 /* STM32F103x6 || STM32F103xB || */
Kojto 96:487b796308b0 606 /* STM32F103xE || STM32F103xG || */
Kojto 96:487b796308b0 607 /* STM32F105xC || STM32F107xC */
Kojto 96:487b796308b0 608
Kojto 96:487b796308b0 609 #ifdef __cplusplus
Kojto 96:487b796308b0 610 }
Kojto 96:487b796308b0 611 #endif
Kojto 96:487b796308b0 612
Kojto 96:487b796308b0 613
Kojto 96:487b796308b0 614 #endif /* __STM32F1xx_LL_USB_H */
Kojto 96:487b796308b0 615
Kojto 96:487b796308b0 616 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/