mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

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

Committer:
mbed_official
Date:
Thu Jul 02 16:30:08 2015 +0100
Revision:
581:39197bcd20f2
Parent:
489:119543c9f674
Synchronized with git revision ae2d3cdffe70184eb8736d94f76c45c93f4b7724

Full URL: https://github.com/mbedmicro/mbed/commit/ae2d3cdffe70184eb8736d94f76c45c93f4b7724/

Make it possible to build the core mbed library with yotta

Who changed what in which revision?

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