STM32F439xx HAL User Manual
stm32f4xx_hal_pcd_ex.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f4xx_hal_pcd_ex.h
00004   * @author  MCD Application Team
00005   * @brief   Header file of PCD HAL module.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
00010   *
00011   * Redistribution and use in source and binary forms, with or without modification,
00012   * are permitted provided that the following conditions are met:
00013   *   1. Redistributions of source code must retain the above copyright notice,
00014   *      this list of conditions and the following disclaimer.
00015   *   2. Redistributions in binary form must reproduce the above copyright notice,
00016   *      this list of conditions and the following disclaimer in the documentation
00017   *      and/or other materials provided with the distribution.
00018   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00019   *      may be used to endorse or promote products derived from this software
00020   *      without specific prior written permission.
00021   *
00022   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00023   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00024   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00025   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00026   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00027   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00028   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00030   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00031   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032   *
00033   ******************************************************************************
00034   */ 
00035 
00036 /* Define to prevent recursive inclusion -------------------------------------*/
00037 #ifndef __STM32F4xx_HAL_PCD_EX_H
00038 #define __STM32F4xx_HAL_PCD_EX_H
00039 
00040 #ifdef __cplusplus
00041  extern "C" {
00042 #endif
00043 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
00044     defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
00045     defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) || \
00046     defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || \
00047     defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) 
00048 /* Includes ------------------------------------------------------------------*/
00049 #include "stm32f4xx_hal_def.h"
00050    
00051 /** @addtogroup STM32F4xx_HAL_Driver
00052   * @{
00053   */
00054 
00055 /** @addtogroup PCDEx
00056   * @{
00057   */
00058 /* Exported types ------------------------------------------------------------*/
00059 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || \
00060     defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)    
00061 typedef enum  
00062 {
00063   PCD_LPM_L0_ACTIVE = 0x00U, /* on */
00064   PCD_LPM_L1_ACTIVE = 0x01U /* LPM L1 sleep */
00065 }PCD_LPM_MsgTypeDef;
00066 #endif /* STM32F446xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Rx || STM32F412Vx || STM32F412Cx || STM32F413xx || STM32F423xx*/
00067 
00068 #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) 
00069 typedef enum  
00070 {
00071   PCD_BCD_ERROR                     = 0xFFU,
00072   PCD_BCD_CONTACT_DETECTION         = 0xFEU,
00073   PCD_BCD_STD_DOWNSTREAM_PORT       = 0xFDU,
00074   PCD_BCD_CHARGING_DOWNSTREAM_PORT  = 0xFCU,
00075   PCD_BCD_DEDICATED_CHARGING_PORT   = 0xFBU,
00076   PCD_BCD_DISCOVERY_COMPLETED       = 0x00U
00077 }PCD_BCD_MsgTypeDef;
00078 #endif /* STM32F412Zx || STM32F412Rx || STM32F412Vx || STM32F412Cx || STM32F413xx || STM32F423xx*/
00079 
00080 /* Exported constants --------------------------------------------------------*/
00081 /* Exported macros -----------------------------------------------------------*/
00082 /* Exported functions --------------------------------------------------------*/
00083 /** @addtogroup PCDEx_Exported_Functions PCD Extended Exported Functions
00084   * @{
00085   */
00086 /** @addtogroup PCDEx_Exported_Functions_Group1 Peripheral Control functions
00087   * @{
00088   */
00089 HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size);
00090 HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size);
00091 #if defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || \
00092     defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) 
00093 HAL_StatusTypeDef HAL_PCDEx_ActivateLPM(PCD_HandleTypeDef *hpcd);
00094 HAL_StatusTypeDef HAL_PCDEx_DeActivateLPM(PCD_HandleTypeDef *hpcd);
00095 void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg);
00096 #endif /* STM32F446xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Rx || STM32F412Vx || STM32F412Cx || STM32F413xx || STM32F423xx */
00097 #if defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx) 
00098 HAL_StatusTypeDef HAL_PCDEx_ActivateBCD(PCD_HandleTypeDef *hpcd);
00099 HAL_StatusTypeDef HAL_PCDEx_DeActivateBCD(PCD_HandleTypeDef *hpcd);
00100 void HAL_PCDEx_BCD_VBUSDetect(PCD_HandleTypeDef *hpcd);
00101 void HAL_PCDEx_BCD_Callback(PCD_HandleTypeDef *hpcd, PCD_BCD_MsgTypeDef msg);
00102 void HAL_PCDEx_ADP_Sensing_Start(PCD_HandleTypeDef *hpcd);
00103 void HAL_PCDEx_ADP_Sensing_Callback(PCD_HandleTypeDef *hpcd);
00104 #endif /* STM32F412Zx || STM32F412Rx || STM32F412Vx || STM32F412Cx || STM32F413xx || STM32F423xx*/
00105 
00106 /**
00107   * @}
00108   */ 
00109 
00110 /**
00111   * @}
00112   */ 
00113 
00114 /**
00115   * @}
00116   */ 
00117 
00118 /**
00119   * @}
00120   */
00121 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||
00122           STM32F401xC || STM32F401xE || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Rx ||
00123           STM32F412Vx || STM32F412Cx || STM32F413xx || STM32F423xx */
00124 #ifdef __cplusplus
00125 }
00126 #endif
00127 
00128 
00129 #endif /* __STM32F4xx_HAL_PCD_EX_H */
00130 
00131 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/