STM32F479xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f4xx_hal_fmpsmbus_ex.c 00004 * @author MCD Application Team 00005 * @brief FMPSMBUS Extended HAL module driver. 00006 * This file provides firmware functions to manage the following 00007 * functionalities of FMPSMBUS Extended peripheral: 00008 * + Extended features functions 00009 * 00010 @verbatim 00011 ============================================================================== 00012 ##### FMPSMBUS peripheral Extended features ##### 00013 ============================================================================== 00014 00015 [..] Comparing to other previous devices, the FMPSMBUS interface for STM32F4xx 00016 devices contains the following additional features 00017 00018 (+) Disable or enable Fast Mode Plus 00019 00020 ##### How to use this driver ##### 00021 ============================================================================== 00022 (#) Configure the enable or disable of fast mode plus driving capability using the functions : 00023 (++) HAL_FMPSMBUSEx_EnableFastModePlus() 00024 (++) HAL_FMPSMBUSEx_DisableFastModePlus() 00025 @endverbatim 00026 ****************************************************************************** 00027 * @attention 00028 * 00029 * <h2><center>© Copyright (c) 2016 STMicroelectronics. 00030 * All rights reserved.</center></h2> 00031 * 00032 * This software component is licensed by ST under BSD 3-Clause license, 00033 * the "License"; You may not use this file except in compliance with the 00034 * License. You may obtain a copy of the License at: 00035 * opensource.org/licenses/BSD-3-Clause 00036 * 00037 ****************************************************************************** 00038 */ 00039 00040 /* Includes ------------------------------------------------------------------*/ 00041 #include "stm32f4xx_hal.h" 00042 00043 /** @addtogroup STM32F4xx_HAL_Driver 00044 * @{ 00045 */ 00046 00047 /** @defgroup FMPSMBUSEx FMPSMBUSEx 00048 * @brief FMPSMBUS Extended HAL module driver 00049 * @{ 00050 */ 00051 00052 #ifdef HAL_FMPSMBUS_MODULE_ENABLED 00053 #if defined(FMPI2C_CR1_PE) 00054 00055 /* Private typedef -----------------------------------------------------------*/ 00056 /* Private define ------------------------------------------------------------*/ 00057 /* Private macro -------------------------------------------------------------*/ 00058 /* Private variables ---------------------------------------------------------*/ 00059 /* Private function prototypes -----------------------------------------------*/ 00060 /* Private functions ---------------------------------------------------------*/ 00061 00062 /** @defgroup FMPSMBUSEx_Exported_Functions FMPSMBUS Extended Exported Functions 00063 * @{ 00064 */ 00065 00066 /** @defgroup FMPSMBUSEx_Exported_Functions_Group3 Fast Mode Plus Functions 00067 * @brief Fast Mode Plus Functions 00068 * 00069 @verbatim 00070 =============================================================================== 00071 ##### Fast Mode Plus Functions ##### 00072 =============================================================================== 00073 [..] This section provides functions allowing to: 00074 (+) Configure Fast Mode Plus 00075 00076 @endverbatim 00077 * @{ 00078 */ 00079 00080 /** 00081 * @brief Enable the FMPSMBUS fast mode plus driving capability. 00082 * @param ConfigFastModePlus Selects the pin. 00083 * This parameter can be one of the @ref FMPSMBUSEx_FastModePlus values 00084 * @note For FMPI2C1, fast mode plus driving capability can be enabled on all selected 00085 * FMPI2C1 pins using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter or independently 00086 * on each one of the following pins PB6, PB7, PB8 and PB9. 00087 * @note For remaining FMPI2C1 pins (PA14, PA15...) fast mode plus driving capability 00088 * can be enabled only by using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter. 00089 * @retval None 00090 */ 00091 void HAL_FMPSMBUSEx_EnableFastModePlus(uint32_t ConfigFastModePlus) 00092 { 00093 /* Check the parameter */ 00094 assert_param(IS_FMPSMBUS_FASTMODEPLUS(ConfigFastModePlus)); 00095 00096 /* Enable SYSCFG clock */ 00097 __HAL_RCC_SYSCFG_CLK_ENABLE(); 00098 00099 /* Enable fast mode plus driving capability for selected pin */ 00100 SET_BIT(SYSCFG->CFGR, (uint32_t)ConfigFastModePlus); 00101 } 00102 00103 /** 00104 * @brief Disable the FMPSMBUS fast mode plus driving capability. 00105 * @param ConfigFastModePlus Selects the pin. 00106 * This parameter can be one of the @ref FMPSMBUSEx_FastModePlus values 00107 * @note For FMPI2C1, fast mode plus driving capability can be disabled on all selected 00108 * FMPI2C1 pins using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter or independently 00109 * on each one of the following pins PB6, PB7, PB8 and PB9. 00110 * @note For remaining FMPI2C1 pins (PA14, PA15...) fast mode plus driving capability 00111 * can be disabled only by using FMPSMBUS_FASTMODEPLUS_FMPI2C1 parameter. 00112 * @retval None 00113 */ 00114 void HAL_FMPSMBUSEx_DisableFastModePlus(uint32_t ConfigFastModePlus) 00115 { 00116 /* Check the parameter */ 00117 assert_param(IS_FMPSMBUS_FASTMODEPLUS(ConfigFastModePlus)); 00118 00119 /* Enable SYSCFG clock */ 00120 __HAL_RCC_SYSCFG_CLK_ENABLE(); 00121 00122 /* Disable fast mode plus driving capability for selected pin */ 00123 CLEAR_BIT(SYSCFG->CFGR, (uint32_t)ConfigFastModePlus); 00124 } 00125 00126 /** 00127 * @} 00128 */ 00129 00130 /** 00131 * @} 00132 */ 00133 00134 /** 00135 * @} 00136 */ 00137 00138 #endif /* FMPI2C_CR1_PE */ 00139 #endif /* HAL_FMPSMBUS_MODULE_ENABLED */ 00140 /** 00141 * @} 00142 */ 00143 00144 /** 00145 * @} 00146 */ 00147 00148 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/