mbed library sources

Dependents:   Marvino mbot

Fork of mbed-src by mbed official

Committer:
jaerts
Date:
Tue Dec 22 13:22:16 2015 +0000
Revision:
637:ed69428d4850
Parent:
610:813dcc80987e
Add very shady LPC1768 CAN Filter implementation

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 573:ad23fe03a082 1 /**
mbed_official 573:ad23fe03a082 2 ******************************************************************************
mbed_official 573:ad23fe03a082 3 * @file stm32f7xx_hal_pcd.h
mbed_official 573:ad23fe03a082 4 * @author MCD Application Team
mbed_official 610:813dcc80987e 5 * @version V1.0.1
mbed_official 610:813dcc80987e 6 * @date 25-June-2015
mbed_official 573:ad23fe03a082 7 * @brief Header file of PCD HAL module.
mbed_official 573:ad23fe03a082 8 ******************************************************************************
mbed_official 573:ad23fe03a082 9 * @attention
mbed_official 573:ad23fe03a082 10 *
mbed_official 573:ad23fe03a082 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mbed_official 573:ad23fe03a082 12 *
mbed_official 573:ad23fe03a082 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 573:ad23fe03a082 14 * are permitted provided that the following conditions are met:
mbed_official 573:ad23fe03a082 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 573:ad23fe03a082 16 * this list of conditions and the following disclaimer.
mbed_official 573:ad23fe03a082 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 573:ad23fe03a082 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 573:ad23fe03a082 19 * and/or other materials provided with the distribution.
mbed_official 573:ad23fe03a082 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 573:ad23fe03a082 21 * may be used to endorse or promote products derived from this software
mbed_official 573:ad23fe03a082 22 * without specific prior written permission.
mbed_official 573:ad23fe03a082 23 *
mbed_official 573:ad23fe03a082 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 573:ad23fe03a082 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 573:ad23fe03a082 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 573:ad23fe03a082 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 573:ad23fe03a082 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 573:ad23fe03a082 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 573:ad23fe03a082 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 573:ad23fe03a082 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 573:ad23fe03a082 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 573:ad23fe03a082 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 573:ad23fe03a082 34 *
mbed_official 573:ad23fe03a082 35 ******************************************************************************
mbed_official 573:ad23fe03a082 36 */
mbed_official 573:ad23fe03a082 37
mbed_official 573:ad23fe03a082 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 573:ad23fe03a082 39 #ifndef __STM32F7xx_HAL_PCD_H
mbed_official 573:ad23fe03a082 40 #define __STM32F7xx_HAL_PCD_H
mbed_official 573:ad23fe03a082 41
mbed_official 573:ad23fe03a082 42 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 43 extern "C" {
mbed_official 573:ad23fe03a082 44 #endif
mbed_official 573:ad23fe03a082 45
mbed_official 573:ad23fe03a082 46 /* Includes ------------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 47 #include "stm32f7xx_ll_usb.h"
mbed_official 573:ad23fe03a082 48
mbed_official 573:ad23fe03a082 49 /** @addtogroup STM32F7xx_HAL_Driver
mbed_official 573:ad23fe03a082 50 * @{
mbed_official 573:ad23fe03a082 51 */
mbed_official 573:ad23fe03a082 52
mbed_official 573:ad23fe03a082 53 /** @addtogroup PCD
mbed_official 573:ad23fe03a082 54 * @{
mbed_official 573:ad23fe03a082 55 */
mbed_official 573:ad23fe03a082 56
mbed_official 573:ad23fe03a082 57 /* Exported types ------------------------------------------------------------*/
mbed_official 573:ad23fe03a082 58 /** @defgroup PCD_Exported_Types PCD Exported Types
mbed_official 573:ad23fe03a082 59 * @{
mbed_official 573:ad23fe03a082 60 */
mbed_official 573:ad23fe03a082 61
mbed_official 573:ad23fe03a082 62 /**
mbed_official 573:ad23fe03a082 63 * @brief PCD State structure definition
mbed_official 573:ad23fe03a082 64 */
mbed_official 573:ad23fe03a082 65 typedef enum
mbed_official 573:ad23fe03a082 66 {
mbed_official 573:ad23fe03a082 67 HAL_PCD_STATE_RESET = 0x00,
mbed_official 573:ad23fe03a082 68 HAL_PCD_STATE_READY = 0x01,
mbed_official 573:ad23fe03a082 69 HAL_PCD_STATE_ERROR = 0x02,
mbed_official 573:ad23fe03a082 70 HAL_PCD_STATE_BUSY = 0x03,
mbed_official 573:ad23fe03a082 71 HAL_PCD_STATE_TIMEOUT = 0x04
mbed_official 573:ad23fe03a082 72 } PCD_StateTypeDef;
mbed_official 573:ad23fe03a082 73
mbed_official 573:ad23fe03a082 74 /* Device LPM suspend state */
mbed_official 573:ad23fe03a082 75 typedef enum
mbed_official 573:ad23fe03a082 76 {
mbed_official 573:ad23fe03a082 77 LPM_L0 = 0x00, /* on */
mbed_official 573:ad23fe03a082 78 LPM_L1 = 0x01, /* LPM L1 sleep */
mbed_official 573:ad23fe03a082 79 LPM_L2 = 0x02, /* suspend */
mbed_official 573:ad23fe03a082 80 LPM_L3 = 0x03, /* off */
mbed_official 573:ad23fe03a082 81 }PCD_LPM_StateTypeDef;
mbed_official 573:ad23fe03a082 82
mbed_official 573:ad23fe03a082 83 typedef USB_OTG_GlobalTypeDef PCD_TypeDef;
mbed_official 573:ad23fe03a082 84 typedef USB_OTG_CfgTypeDef PCD_InitTypeDef;
mbed_official 573:ad23fe03a082 85 typedef USB_OTG_EPTypeDef PCD_EPTypeDef ;
mbed_official 573:ad23fe03a082 86
mbed_official 573:ad23fe03a082 87 /**
mbed_official 573:ad23fe03a082 88 * @brief PCD Handle Structure definition
mbed_official 573:ad23fe03a082 89 */
mbed_official 573:ad23fe03a082 90 typedef struct
mbed_official 573:ad23fe03a082 91 {
mbed_official 573:ad23fe03a082 92 PCD_TypeDef *Instance; /*!< Register base address */
mbed_official 573:ad23fe03a082 93 PCD_InitTypeDef Init; /*!< PCD required parameters */
mbed_official 573:ad23fe03a082 94 PCD_EPTypeDef IN_ep[15]; /*!< IN endpoint parameters */
mbed_official 573:ad23fe03a082 95 PCD_EPTypeDef OUT_ep[15]; /*!< OUT endpoint parameters */
mbed_official 573:ad23fe03a082 96 HAL_LockTypeDef Lock; /*!< PCD peripheral status */
mbed_official 573:ad23fe03a082 97 __IO PCD_StateTypeDef State; /*!< PCD communication state */
mbed_official 573:ad23fe03a082 98 uint32_t Setup[12]; /*!< Setup packet buffer */
mbed_official 573:ad23fe03a082 99 PCD_LPM_StateTypeDef LPM_State; /*!< LPM State */
mbed_official 573:ad23fe03a082 100 uint32_t BESL;
mbed_official 573:ad23fe03a082 101 uint32_t lpm_active; /*!< Enable or disable the Link Power Management .
mbed_official 573:ad23fe03a082 102 This parameter can be set to ENABLE or DISABLE */
mbed_official 573:ad23fe03a082 103 void *pData; /*!< Pointer to upper stack Handler */
mbed_official 573:ad23fe03a082 104 } PCD_HandleTypeDef;
mbed_official 573:ad23fe03a082 105
mbed_official 573:ad23fe03a082 106 /**
mbed_official 573:ad23fe03a082 107 * @}
mbed_official 573:ad23fe03a082 108 */
mbed_official 573:ad23fe03a082 109
mbed_official 573:ad23fe03a082 110 /* Include PCD HAL Extension module */
mbed_official 573:ad23fe03a082 111 #include "stm32f7xx_hal_pcd_ex.h"
mbed_official 573:ad23fe03a082 112
mbed_official 573:ad23fe03a082 113 /* Exported constants --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 114 /** @defgroup PCD_Exported_Constants PCD Exported Constants
mbed_official 573:ad23fe03a082 115 * @{
mbed_official 573:ad23fe03a082 116 */
mbed_official 573:ad23fe03a082 117
mbed_official 573:ad23fe03a082 118 /** @defgroup PCD_Speed PCD Speed
mbed_official 573:ad23fe03a082 119 * @{
mbed_official 573:ad23fe03a082 120 */
mbed_official 573:ad23fe03a082 121 #define PCD_SPEED_HIGH 0
mbed_official 573:ad23fe03a082 122 #define PCD_SPEED_HIGH_IN_FULL 1
mbed_official 573:ad23fe03a082 123 #define PCD_SPEED_FULL 2
mbed_official 573:ad23fe03a082 124 /**
mbed_official 573:ad23fe03a082 125 * @}
mbed_official 573:ad23fe03a082 126 */
mbed_official 573:ad23fe03a082 127
mbed_official 573:ad23fe03a082 128 /** @defgroup PCD_PHY_Module PCD PHY Module
mbed_official 573:ad23fe03a082 129 * @{
mbed_official 573:ad23fe03a082 130 */
mbed_official 573:ad23fe03a082 131 #define PCD_PHY_ULPI 1
mbed_official 573:ad23fe03a082 132 #define PCD_PHY_EMBEDDED 2
mbed_official 573:ad23fe03a082 133 /**
mbed_official 573:ad23fe03a082 134 * @}
mbed_official 573:ad23fe03a082 135 */
mbed_official 573:ad23fe03a082 136
mbed_official 573:ad23fe03a082 137 /** @defgroup PCD_Turnaround_Timeout Turnaround Timeout Value
mbed_official 573:ad23fe03a082 138 * @{
mbed_official 573:ad23fe03a082 139 */
mbed_official 573:ad23fe03a082 140 #ifndef USBD_HS_TRDT_VALUE
mbed_official 573:ad23fe03a082 141 #define USBD_HS_TRDT_VALUE 9
mbed_official 573:ad23fe03a082 142 #endif /* USBD_HS_TRDT_VALUE */
mbed_official 573:ad23fe03a082 143 #ifndef USBD_FS_TRDT_VALUE
mbed_official 573:ad23fe03a082 144 #define USBD_FS_TRDT_VALUE 5
mbed_official 573:ad23fe03a082 145 #endif /* USBD_HS_TRDT_VALUE */
mbed_official 573:ad23fe03a082 146
mbed_official 573:ad23fe03a082 147 /**
mbed_official 573:ad23fe03a082 148 * @}
mbed_official 573:ad23fe03a082 149 */
mbed_official 573:ad23fe03a082 150
mbed_official 573:ad23fe03a082 151 /**
mbed_official 573:ad23fe03a082 152 * @}
mbed_official 573:ad23fe03a082 153 */
mbed_official 573:ad23fe03a082 154
mbed_official 573:ad23fe03a082 155 /* Exported macros -----------------------------------------------------------*/
mbed_official 573:ad23fe03a082 156 /** @defgroup PCD_Exported_Macros PCD Exported Macros
mbed_official 573:ad23fe03a082 157 * @brief macros to handle interrupts and specific clock configurations
mbed_official 573:ad23fe03a082 158 * @{
mbed_official 573:ad23fe03a082 159 */
mbed_official 573:ad23fe03a082 160 #define __HAL_PCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance)
mbed_official 573:ad23fe03a082 161 #define __HAL_PCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance)
mbed_official 573:ad23fe03a082 162
mbed_official 573:ad23fe03a082 163 #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__))
mbed_official 573:ad23fe03a082 164 #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__))
mbed_official 573:ad23fe03a082 165 #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0)
mbed_official 573:ad23fe03a082 166
mbed_official 573:ad23fe03a082 167
mbed_official 573:ad23fe03a082 168 #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= \
mbed_official 573:ad23fe03a082 169 ~(USB_OTG_PCGCCTL_STOPCLK)
mbed_official 573:ad23fe03a082 170
mbed_official 573:ad23fe03a082 171 #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK
mbed_official 573:ad23fe03a082 172
mbed_official 573:ad23fe03a082 173 #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE))&0x10)
mbed_official 573:ad23fe03a082 174
mbed_official 573:ad23fe03a082 175 #define USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08)
mbed_official 573:ad23fe03a082 176 #define USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C)
mbed_official 573:ad23fe03a082 177 #define USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10)
mbed_official 573:ad23fe03a082 178
mbed_official 573:ad23fe03a082 179 #define USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE ((uint32_t)0x08)
mbed_official 573:ad23fe03a082 180 #define USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE ((uint32_t)0x0C)
mbed_official 573:ad23fe03a082 181 #define USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE ((uint32_t)0x10)
mbed_official 573:ad23fe03a082 182
mbed_official 573:ad23fe03a082 183 #define USB_OTG_HS_WAKEUP_EXTI_LINE ((uint32_t)0x00100000) /*!< External interrupt line 20 Connected to the USB HS EXTI Line */
mbed_official 573:ad23fe03a082 184 #define USB_OTG_FS_WAKEUP_EXTI_LINE ((uint32_t)0x00040000) /*!< External interrupt line 18 Connected to the USB FS EXTI Line */
mbed_official 573:ad23fe03a082 185
mbed_official 573:ad23fe03a082 186 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (USB_OTG_HS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 187 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 188 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_HS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 189 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (USB_OTG_HS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 190
mbed_official 573:ad23fe03a082 191 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\
mbed_official 573:ad23fe03a082 192 EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE
mbed_official 573:ad23fe03a082 193
mbed_official 573:ad23fe03a082 194 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_HS_WAKEUP_EXTI_LINE);\
mbed_official 573:ad23fe03a082 195 EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 196
mbed_official 573:ad23fe03a082 197 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE);\
mbed_official 573:ad23fe03a082 198 EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE;)\
mbed_official 573:ad23fe03a082 199 EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE;\
mbed_official 573:ad23fe03a082 200 EXTI->FTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE
mbed_official 573:ad23fe03a082 201
mbed_official 573:ad23fe03a082 202 #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 203
mbed_official 573:ad23fe03a082 204 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= USB_OTG_FS_WAKEUP_EXTI_LINE
mbed_official 573:ad23fe03a082 205 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 206 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_FS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 207 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = USB_OTG_FS_WAKEUP_EXTI_LINE
mbed_official 573:ad23fe03a082 208
mbed_official 573:ad23fe03a082 209 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE() EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
mbed_official 573:ad23fe03a082 210 EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE
mbed_official 573:ad23fe03a082 211
mbed_official 573:ad23fe03a082 212
mbed_official 573:ad23fe03a082 213 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (USB_OTG_FS_WAKEUP_EXTI_LINE);\
mbed_official 573:ad23fe03a082 214 EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 215
mbed_official 573:ad23fe03a082 216 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE() EXTI->RTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
mbed_official 573:ad23fe03a082 217 EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE);\
mbed_official 573:ad23fe03a082 218 EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE;\
mbed_official 573:ad23fe03a082 219 EXTI->FTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE
mbed_official 573:ad23fe03a082 220
mbed_official 573:ad23fe03a082 221 #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= USB_OTG_FS_WAKEUP_EXTI_LINE)
mbed_official 573:ad23fe03a082 222
mbed_official 573:ad23fe03a082 223 /* Exported functions --------------------------------------------------------*/
mbed_official 573:ad23fe03a082 224 /** @addtogroup PCD_Exported_Functions PCD Exported Functions
mbed_official 573:ad23fe03a082 225 * @{
mbed_official 573:ad23fe03a082 226 */
mbed_official 573:ad23fe03a082 227
mbed_official 573:ad23fe03a082 228 /* Initialization/de-initialization functions ********************************/
mbed_official 573:ad23fe03a082 229 /** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions
mbed_official 573:ad23fe03a082 230 * @{
mbed_official 573:ad23fe03a082 231 */
mbed_official 573:ad23fe03a082 232 HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 233 HAL_StatusTypeDef HAL_PCD_DeInit (PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 234 void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 235 void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 236 /**
mbed_official 573:ad23fe03a082 237 * @}
mbed_official 573:ad23fe03a082 238 */
mbed_official 573:ad23fe03a082 239
mbed_official 573:ad23fe03a082 240 /* I/O operation functions ***************************************************/
mbed_official 573:ad23fe03a082 241 /* Non-Blocking mode: Interrupt */
mbed_official 573:ad23fe03a082 242 /** @addtogroup PCD_Exported_Functions_Group2 IO operation functions
mbed_official 573:ad23fe03a082 243 * @{
mbed_official 573:ad23fe03a082 244 */
mbed_official 573:ad23fe03a082 245 HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 246 HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 247 void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 248
mbed_official 573:ad23fe03a082 249 void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
mbed_official 573:ad23fe03a082 250 void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
mbed_official 573:ad23fe03a082 251 void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 252 void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 253 void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 254 void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 255 void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 256 void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
mbed_official 573:ad23fe03a082 257 void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
mbed_official 573:ad23fe03a082 258 void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 259 void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 260 /**
mbed_official 573:ad23fe03a082 261 * @}
mbed_official 573:ad23fe03a082 262 */
mbed_official 573:ad23fe03a082 263
mbed_official 573:ad23fe03a082 264 /* Peripheral Control functions **********************************************/
mbed_official 573:ad23fe03a082 265 /** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions
mbed_official 573:ad23fe03a082 266 * @{
mbed_official 573:ad23fe03a082 267 */
mbed_official 573:ad23fe03a082 268 HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 269 HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 270 HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address);
mbed_official 573:ad23fe03a082 271 HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type);
mbed_official 573:ad23fe03a082 272 HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
mbed_official 573:ad23fe03a082 273 HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
mbed_official 573:ad23fe03a082 274 HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
mbed_official 573:ad23fe03a082 275 uint16_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
mbed_official 573:ad23fe03a082 276 HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
mbed_official 573:ad23fe03a082 277 HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
mbed_official 573:ad23fe03a082 278 HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
mbed_official 573:ad23fe03a082 279 HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 280 HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 281 /**
mbed_official 573:ad23fe03a082 282 * @}
mbed_official 573:ad23fe03a082 283 */
mbed_official 573:ad23fe03a082 284
mbed_official 573:ad23fe03a082 285 /* Peripheral State functions ************************************************/
mbed_official 573:ad23fe03a082 286 /** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
mbed_official 573:ad23fe03a082 287 * @{
mbed_official 573:ad23fe03a082 288 */
mbed_official 573:ad23fe03a082 289 PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
mbed_official 573:ad23fe03a082 290 /**
mbed_official 573:ad23fe03a082 291 * @}
mbed_official 573:ad23fe03a082 292 */
mbed_official 573:ad23fe03a082 293
mbed_official 573:ad23fe03a082 294 /**
mbed_official 573:ad23fe03a082 295 * @}
mbed_official 573:ad23fe03a082 296 */
mbed_official 573:ad23fe03a082 297
mbed_official 573:ad23fe03a082 298 /** @defgroup PCD_Instance_definition PCD Instance definition
mbed_official 573:ad23fe03a082 299 * @{
mbed_official 573:ad23fe03a082 300 */
mbed_official 573:ad23fe03a082 301 #define IS_PCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS) || \
mbed_official 573:ad23fe03a082 302 ((INSTANCE) == USB_OTG_HS))
mbed_official 573:ad23fe03a082 303 /**
mbed_official 573:ad23fe03a082 304 * @}
mbed_official 573:ad23fe03a082 305 */
mbed_official 573:ad23fe03a082 306
mbed_official 573:ad23fe03a082 307 /**
mbed_official 573:ad23fe03a082 308 * @}
mbed_official 573:ad23fe03a082 309 */
mbed_official 573:ad23fe03a082 310
mbed_official 573:ad23fe03a082 311 /**
mbed_official 573:ad23fe03a082 312 * @}
mbed_official 573:ad23fe03a082 313 */
mbed_official 573:ad23fe03a082 314
mbed_official 573:ad23fe03a082 315 /**
mbed_official 573:ad23fe03a082 316 * @}
mbed_official 573:ad23fe03a082 317 */
mbed_official 573:ad23fe03a082 318
mbed_official 573:ad23fe03a082 319 #ifdef __cplusplus
mbed_official 573:ad23fe03a082 320 }
mbed_official 573:ad23fe03a082 321 #endif
mbed_official 573:ad23fe03a082 322
mbed_official 573:ad23fe03a082 323
mbed_official 573:ad23fe03a082 324 #endif /* __STM32F7xx_HAL_PCD_H */
mbed_official 573:ad23fe03a082 325
mbed_official 573:ad23fe03a082 326 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/