annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_pcd.h @ 85:923c4566a2a1 kittz

increased interCPU baudrate, cpu2: i2c in SPI1 IRQ
author Dmitry Romanov <kitt@bk.ru>
date Wed, 21 Nov 2018 12:49:54 +0300
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_hal_pcd.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 PCD 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_HAL_PCD_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_HAL_PCD_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_ll_usb.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** @addtogroup STM32F4xx_HAL_Driver
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 PCD
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 /** @defgroup PCD_Exported_Types PCD Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 * @brief PCD State structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 HAL_PCD_STATE_RESET = 0x00,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 HAL_PCD_STATE_READY = 0x01,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 HAL_PCD_STATE_ERROR = 0x02,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 HAL_PCD_STATE_BUSY = 0x03,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 HAL_PCD_STATE_TIMEOUT = 0x04
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 } PCD_StateTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 typedef USB_OTG_GlobalTypeDef PCD_TypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 typedef USB_OTG_CfgTypeDef PCD_InitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 typedef USB_OTG_EPTypeDef PCD_EPTypeDef ;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 * @brief PCD Handle Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 PCD_TypeDef *Instance; /*!< Register base address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 PCD_InitTypeDef Init; /*!< PCD required parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 PCD_EPTypeDef IN_ep[15]; /*!< IN endpoint parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 PCD_EPTypeDef OUT_ep[15]; /*!< OUT endpoint parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 HAL_LockTypeDef Lock; /*!< PCD peripheral status */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 __IO PCD_StateTypeDef State; /*!< PCD communication state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 uint32_t Setup[12]; /*!< Setup packet buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 void *pData; /*!< Pointer to upper stack Handler */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 } PCD_HandleTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 /* Include PCD HAL Extension module */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 #include "stm32f4xx_hal_pcd_ex.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 /** @defgroup PCD_Exported_Constants PCD Exported Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 /** @defgroup PCD_Speed PCD Speed
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 #define PCD_SPEED_HIGH 0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 #define PCD_SPEED_HIGH_IN_FULL 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 #define PCD_SPEED_FULL 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 /** @defgroup PCD_PHY_Module PCD PHY Module
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 #define PCD_PHY_ULPI 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 #define PCD_PHY_EMBEDDED 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 /* Exported macros -----------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 /** @defgroup PCD_Exported_Macros PCD Exported Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 * @brief macros to handle interrupts and specific clock configurations
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 #define __HAL_PCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 #define __HAL_PCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 ~(USB_OTG_PCGCCTL_STOPCLK)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE))&0x10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 #define USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 #define USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 #define USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 #define USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 #define USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 #define USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 #define USB_OTG_HS_WAKEUP_EXTI_LINE ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the USB HS EXTI Line */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 #define USB_OTG_FS_WAKEUP_EXTI_LINE ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (USB_OTG_HS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_HS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (USB_OTG_HS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_HS_WAKEUP_EXTI_LINE);\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE;)\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE;\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 EXTI->FTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= USB_OTG_FS_WAKEUP_EXTI_LINE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_FS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = USB_OTG_FS_WAKEUP_EXTI_LINE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_FS_WAKEUP_EXTI_LINE);\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE;\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 EXTI->FTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 /** @addtogroup PCD_Exported_Functions PCD Exported Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 /* Initialization/de-initialization functions ********************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 /** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 /* I/O operation functions ***************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 /* Non-Blocking mode: Interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 /** @addtogroup PCD_Exported_Functions_Group2 IO operation functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 /* Non-Blocking mode: Interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 /**
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 /* Peripheral Control functions **********************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 /** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions
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 HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
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 /* Peripheral State functions ************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 /** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 /**
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 * @}
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 /** @defgroup PCD_Instance_definition PCD Instance definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 ((INSTANCE) == USB_OTG_HS))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 #elif defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 #endif
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 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 * @}
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 */
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 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 #endif
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 #endif /* __STM32F4xx_HAL_PCD_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/