TUKS MCU Introductory course / TUKS-COURSE-TIMER
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

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