annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_ll_usb.h @ 112:fdf0272e9213 FlipDisplay

Added new nvm parameter"FlipDisplay" indicating the screen orientation
author Ideenmodellierer
date Tue, 01 Jan 2019 21:03:33 +0100
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file stm32f4xx_ll_usb.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author MCD Application Team
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V1.2.0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 26-December-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief Header file of USB Core HAL module.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 * without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #ifndef __STM32F4xx_LL_USB_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_LL_USB_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "stm32f4xx_hal_def.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** @addtogroup STM32F4xx_HAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 /** @addtogroup USB_Core
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 /* Exported types ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 * @brief USB Mode definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 USB_OTG_DEVICE_MODE = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 USB_OTG_HOST_MODE = 1,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 USB_OTG_DRD_MODE = 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 }USB_OTG_ModeTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 * @brief URB States definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 typedef enum {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 URB_IDLE = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 URB_DONE,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 URB_NOTREADY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 URB_NYET,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 URB_ERROR,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 URB_STALL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 }USB_OTG_URBStateTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 * @brief Host channel States definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 typedef enum {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 HC_IDLE = 0,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 HC_XFRC,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 HC_HALTED,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 HC_NAK,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 HC_NYET,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 HC_STALL,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 HC_XACTERR,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 HC_BBLERR,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 HC_DATATGLERR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 }USB_OTG_HCStateTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 * @brief PCD Initialization Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 uint32_t dev_endpoints; /*!< Device Endpoints number.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 This parameter depends on the used USB core.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 uint32_t Host_channels; /*!< Host Channels number.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 This parameter Depends on the used USB core.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 uint32_t speed; /*!< USB Core speed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 This parameter can be any value of @ref USB_Core_Speed_ */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 uint32_t dma_enable; /*!< Enable or disable of the USB embedded DMA. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 This parameter can be any value of @ref USB_EP0_MPS_ */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 uint32_t phy_itface; /*!< Select the used PHY interface.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 This parameter can be any value of @ref USB_Core_PHY_ */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 uint32_t low_power_enable; /*!< Enable or disable the low power mode. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 uint32_t vbus_sensing_enable; /*!< Enable or disable the VBUS Sensing feature. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 uint32_t use_dedicated_ep1; /*!< Enable or disable the use of the dedicated EP1 interrupt. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 uint32_t use_external_vbus; /*!< Enable or disable the use of the external VBUS. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 }USB_OTG_CfgTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 uint8_t num; /*!< Endpoint number
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 uint8_t is_in; /*!< Endpoint direction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 uint8_t is_stall; /*!< Endpoint stall condition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 uint8_t type; /*!< Endpoint type
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 This parameter can be any value of @ref USB_EP_Type_ */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 uint8_t data_pid_start; /*!< Initial data PID
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 uint8_t even_odd_frame; /*!< IFrame parity
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 uint16_t tx_fifo_num; /*!< Transmission FIFO number
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 uint32_t maxpacket; /*!< Endpoint Max packet size
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 uint8_t *xfer_buff; /*!< Pointer to transfer buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 uint32_t xfer_len; /*!< Current transfer length */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 }USB_OTG_EPTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 uint8_t dev_addr ; /*!< USB device address.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 This parameter must be a number between Min_Data = 1 and Max_Data = 255 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 uint8_t ch_num; /*!< Host channel number.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 uint8_t ep_num; /*!< Endpoint number.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 uint8_t ep_is_in; /*!< Endpoint direction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 uint8_t speed; /*!< USB Host speed.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 This parameter can be any value of @ref USB_Core_Speed_ */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 uint8_t do_ping; /*!< Enable or disable the use of the PING protocol for HS mode. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 uint8_t process_ping; /*!< Execute the PING protocol for HS mode. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 uint8_t ep_type; /*!< Endpoint Type.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 This parameter can be any value of @ref USB_EP_Type_ */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 uint16_t max_packet; /*!< Endpoint Max packet size.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 uint8_t data_pid; /*!< Initial data PID.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 uint8_t *xfer_buff; /*!< Pointer to transfer buffer. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 uint32_t xfer_len; /*!< Current transfer length. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 uint8_t toggle_in; /*!< IN transfer current toggle flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 uint8_t toggle_out; /*!< OUT transfer current toggle flag
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 uint32_t ErrCnt; /*!< Host channel error count.*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 USB_OTG_URBStateTypeDef urb_state; /*!< URB state.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 This parameter can be any value of @ref USB_OTG_URBStateTypeDef */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 USB_OTG_HCStateTypeDef state; /*!< Host Channel state.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 This parameter can be any value of @ref USB_OTG_HCStateTypeDef */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 }USB_OTG_HCTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 /** @defgroup PCD_Exported_Constants PCD Exported Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 /** @defgroup USB_Core_Mode_ USB Core Mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 #define USB_OTG_MODE_DEVICE 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 #define USB_OTG_MODE_HOST 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 #define USB_OTG_MODE_DRD 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 /** @defgroup USB_Core_Speed_ USB Core Speed
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 #define USB_OTG_SPEED_HIGH 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 #define USB_OTG_SPEED_HIGH_IN_FULL 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 #define USB_OTG_SPEED_LOW 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 #define USB_OTG_SPEED_FULL 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 /** @defgroup USB_Core_PHY_ USB Core PHY
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 #define USB_OTG_ULPI_PHY 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 #define USB_OTG_EMBEDDED_PHY 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 /** @defgroup USB_Core_MPS_ USB Core MPS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 #define USB_OTG_HS_MAX_PACKET_SIZE 512
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 #define USB_OTG_FS_MAX_PACKET_SIZE 64
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 #define USB_OTG_MAX_EP0_SIZE 64
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 /** @defgroup USB_Core_Phy_Frequency_ USB Core Phy Frequency
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 #define DSTS_ENUMSPD_HS_PHY_30MHZ_OR_60MHZ (0 << 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 #define DSTS_ENUMSPD_FS_PHY_30MHZ_OR_60MHZ (1 << 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 #define DSTS_ENUMSPD_LS_PHY_6MHZ (2 << 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 #define DSTS_ENUMSPD_FS_PHY_48MHZ (3 << 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 /** @defgroup USB_CORE_Frame_Interval_ USB CORE Frame Interval
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 #define DCFG_FRAME_INTERVAL_80 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 #define DCFG_FRAME_INTERVAL_85 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 #define DCFG_FRAME_INTERVAL_90 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 #define DCFG_FRAME_INTERVAL_95 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 /** @defgroup USB_EP0_MPS_ USB EP0 MPS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 #define DEP0CTL_MPS_64 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 #define DEP0CTL_MPS_32 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 #define DEP0CTL_MPS_16 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 #define DEP0CTL_MPS_8 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 /** @defgroup USB_EP_Speed_ USB EP Speed
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 #define EP_SPEED_LOW 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 #define EP_SPEED_FULL 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 #define EP_SPEED_HIGH 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 /** @defgroup USB_EP_Type_ USB EP Type
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 #define EP_TYPE_CTRL 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 #define EP_TYPE_ISOC 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 #define EP_TYPE_BULK 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 #define EP_TYPE_INTR 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 #define EP_TYPE_MSK 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 /** @defgroup USB_STS_Defines_ USB STS Defines
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 #define STS_GOUT_NAK 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 #define STS_DATA_UPDT 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 #define STS_XFER_COMP 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 #define STS_SETUP_COMP 4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 #define STS_SETUP_UPDT 6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 /** @defgroup HCFG_SPEED_Defines_ HCFG SPEED Defines
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 #define HCFG_30_60_MHZ 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 #define HCFG_48_MHZ 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 #define HCFG_6_MHZ 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 /** @defgroup HPRT0_PRTSPD_SPEED_Defines_ HPRT0 PRTSPD SPEED Defines
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 #define HPRT0_PRTSPD_HIGH_SPEED 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 #define HPRT0_PRTSPD_FULL_SPEED 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 #define HPRT0_PRTSPD_LOW_SPEED 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 #define HCCHAR_CTRL 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 #define HCCHAR_ISOC 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 #define HCCHAR_BULK 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 #define HCCHAR_INTR 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 #define HC_PID_DATA0 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 #define HC_PID_DATA2 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 #define HC_PID_DATA1 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 #define HC_PID_SETUP 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 #define GRXSTS_PKTSTS_IN 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 #define GRXSTS_PKTSTS_IN_XFER_COMP 3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 #define GRXSTS_PKTSTS_DATA_TOGGLE_ERR 5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 #define GRXSTS_PKTSTS_CH_HALTED 7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 #define USBx_PCGCCTL *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_PCGCCTL_BASE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 #define USBx_HPRT0 *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_HOST_PORT_BASE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 #define USBx_DEVICE ((USB_OTG_DeviceTypeDef *)((uint32_t )USBx + USB_OTG_DEVICE_BASE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 #define USBx_INEP(i) ((USB_OTG_INEndpointTypeDef *)((uint32_t)USBx + USB_OTG_IN_ENDPOINT_BASE + (i)*USB_OTG_EP_REG_SIZE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 #define USBx_OUTEP(i) ((USB_OTG_OUTEndpointTypeDef *)((uint32_t)USBx + USB_OTG_OUT_ENDPOINT_BASE + (i)*USB_OTG_EP_REG_SIZE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 #define USBx_DFIFO(i) *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_FIFO_BASE + (i) * USB_OTG_FIFO_SIZE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 #define USBx_HOST ((USB_OTG_HostTypeDef *)((uint32_t )USBx + USB_OTG_HOST_BASE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 #define USBx_HC(i) ((USB_OTG_HostChannelTypeDef *)((uint32_t)USBx + USB_OTG_HOST_CHANNEL_BASE + (i)*USB_OTG_HOST_CHANNEL_SIZE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 #define USB_MASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK &= ~(__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 #define USB_UNMASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK |= (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 #define CLEAR_IN_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_INEP(__EPNUM__)->DIEPINT = (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 #define CLEAR_OUT_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_OUTEP(__EPNUM__)->DOEPINT = (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 HAL_StatusTypeDef USB_CoreInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 HAL_StatusTypeDef USB_DevInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 HAL_StatusTypeDef USB_EnableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 HAL_StatusTypeDef USB_SetCurrentMode(USB_OTG_GlobalTypeDef *USBx , USB_OTG_ModeTypeDef mode);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 HAL_StatusTypeDef USB_SetDevSpeed(USB_OTG_GlobalTypeDef *USBx , uint8_t speed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 HAL_StatusTypeDef USB_FlushRxFifo (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 HAL_StatusTypeDef USB_FlushTxFifo (USB_OTG_GlobalTypeDef *USBx, uint32_t num );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 HAL_StatusTypeDef USB_ActivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 HAL_StatusTypeDef USB_DeactivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 HAL_StatusTypeDef USB_ActivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 HAL_StatusTypeDef USB_DeactivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 HAL_StatusTypeDef USB_EPStartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep, uint8_t dma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 HAL_StatusTypeDef USB_EP0StartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep, uint8_t dma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len, uint8_t dma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 void * USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 HAL_StatusTypeDef USB_EPSetStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 HAL_StatusTypeDef USB_EPClearStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 HAL_StatusTypeDef USB_SetDevAddress (USB_OTG_GlobalTypeDef *USBx, uint8_t address);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 HAL_StatusTypeDef USB_DevConnect (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 HAL_StatusTypeDef USB_DevDisconnect (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 HAL_StatusTypeDef USB_StopDevice(USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 HAL_StatusTypeDef USB_ActivateSetup (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 HAL_StatusTypeDef USB_EP0_OutStart(USB_OTG_GlobalTypeDef *USBx, uint8_t dma, uint8_t *psetup);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 uint8_t USB_GetDevSpeed(USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 uint32_t USB_GetMode(USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 uint32_t USB_ReadInterrupts (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 uint32_t USB_ReadDevAllOutEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 uint32_t USB_ReadDevOutEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 uint32_t USB_ReadDevAllInEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 uint32_t USB_ReadDevInEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 void USB_ClearInterrupts (USB_OTG_GlobalTypeDef *USBx, uint32_t interrupt);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 HAL_StatusTypeDef USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 HAL_StatusTypeDef USB_InitFSLSPClkSel(USB_OTG_GlobalTypeDef *USBx , uint8_t freq);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 HAL_StatusTypeDef USB_ResetPort(USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 HAL_StatusTypeDef USB_DriveVbus (USB_OTG_GlobalTypeDef *USBx, uint8_t state);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 uint32_t USB_GetHostSpeed (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 uint32_t USB_GetCurrentFrame (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 HAL_StatusTypeDef USB_HC_Init(USB_OTG_GlobalTypeDef *USBx,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 uint8_t ch_num,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 uint8_t epnum,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 uint8_t dev_address,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 uint8_t speed,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 uint8_t ep_type,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 uint16_t mps);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 HAL_StatusTypeDef USB_HC_StartXfer(USB_OTG_GlobalTypeDef *USBx, USB_OTG_HCTypeDef *hc, uint8_t dma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 uint32_t USB_HC_ReadInterrupt (USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 HAL_StatusTypeDef USB_HC_Halt(USB_OTG_GlobalTypeDef *USBx , uint8_t hc_num);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 HAL_StatusTypeDef USB_DoPing(USB_OTG_GlobalTypeDef *USBx , uint8_t ch_num);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 HAL_StatusTypeDef USB_StopHost(USB_OTG_GlobalTypeDef *USBx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 #endif /* __STM32F4xx_LL_USB_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/