mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
<>
Date:
Mon Jan 16 15:03:32 2017 +0000
Revision:
156:95d6b41a828b
Parent:
149:156823d33999
Child:
180:96ed750bd169
This updates the lib to the mbed lib v134

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 144:ef7eb2e8f9f7 1 /**
<> 144:ef7eb2e8f9f7 2 ******************************************************************************
<> 144:ef7eb2e8f9f7 3 * @file stm32f0xx_hal_i2c_ex.c
<> 144:ef7eb2e8f9f7 4 * @author MCD Application Team
<> 156:95d6b41a828b 5 * @version V1.5.0
<> 156:95d6b41a828b 6 * @date 04-November-2016
<> 144:ef7eb2e8f9f7 7 * @brief I2C Extended HAL module driver.
<> 144:ef7eb2e8f9f7 8 * This file provides firmware functions to manage the following
<> 144:ef7eb2e8f9f7 9 * functionalities of I2C Extended peripheral:
<> 144:ef7eb2e8f9f7 10 * + Extended features functions
<> 156:95d6b41a828b 11 *
<> 144:ef7eb2e8f9f7 12 @verbatim
<> 144:ef7eb2e8f9f7 13 ==============================================================================
<> 144:ef7eb2e8f9f7 14 ##### I2C peripheral Extended features #####
<> 144:ef7eb2e8f9f7 15 ==============================================================================
<> 156:95d6b41a828b 16
<> 144:ef7eb2e8f9f7 17 [..] Comparing to other previous devices, the I2C interface for STM32F0xx
<> 144:ef7eb2e8f9f7 18 devices contains the following additional features
<> 156:95d6b41a828b 19
<> 144:ef7eb2e8f9f7 20 (+) Possibility to disable or enable Analog Noise Filter
<> 144:ef7eb2e8f9f7 21 (+) Use of a configured Digital Noise Filter
<> 144:ef7eb2e8f9f7 22 (+) Disable or enable wakeup from Stop mode
<> 156:95d6b41a828b 23
<> 144:ef7eb2e8f9f7 24 ##### How to use this driver #####
<> 144:ef7eb2e8f9f7 25 ==============================================================================
<> 144:ef7eb2e8f9f7 26 [..] This driver provides functions to configure Noise Filter and Wake Up Feature
<> 144:ef7eb2e8f9f7 27 (#) Configure I2C Analog noise filter using the function HAL_I2CEx_ConfigAnalogFilter()
<> 144:ef7eb2e8f9f7 28 (#) Configure I2C Digital noise filter using the function HAL_I2CEx_ConfigDigitalFilter()
<> 144:ef7eb2e8f9f7 29 (#) Configure the enable or disable of I2C Wake Up Mode using the functions :
<> 144:ef7eb2e8f9f7 30 (++) HAL_I2CEx_EnableWakeUp()
<> 144:ef7eb2e8f9f7 31 (++) HAL_I2CEx_DisableWakeUp()
<> 144:ef7eb2e8f9f7 32 (#) Configure the enable or disable of fast mode plus driving capability using the functions :
<> 144:ef7eb2e8f9f7 33 (++) HAL_I2CEx_EnableFastModePlus()
<> 156:95d6b41a828b 34 (++) HAL_I2CEx_DisableFastModePlus()
<> 144:ef7eb2e8f9f7 35 @endverbatim
<> 144:ef7eb2e8f9f7 36 ******************************************************************************
<> 144:ef7eb2e8f9f7 37 * @attention
<> 144:ef7eb2e8f9f7 38 *
<> 144:ef7eb2e8f9f7 39 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
<> 144:ef7eb2e8f9f7 40 *
<> 144:ef7eb2e8f9f7 41 * Redistribution and use in source and binary forms, with or without modification,
<> 144:ef7eb2e8f9f7 42 * are permitted provided that the following conditions are met:
<> 144:ef7eb2e8f9f7 43 * 1. Redistributions of source code must retain the above copyright notice,
<> 144:ef7eb2e8f9f7 44 * this list of conditions and the following disclaimer.
<> 144:ef7eb2e8f9f7 45 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 144:ef7eb2e8f9f7 46 * this list of conditions and the following disclaimer in the documentation
<> 144:ef7eb2e8f9f7 47 * and/or other materials provided with the distribution.
<> 144:ef7eb2e8f9f7 48 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 144:ef7eb2e8f9f7 49 * may be used to endorse or promote products derived from this software
<> 144:ef7eb2e8f9f7 50 * without specific prior written permission.
<> 144:ef7eb2e8f9f7 51 *
<> 144:ef7eb2e8f9f7 52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 144:ef7eb2e8f9f7 53 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 144:ef7eb2e8f9f7 54 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 144:ef7eb2e8f9f7 55 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 144:ef7eb2e8f9f7 56 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 144:ef7eb2e8f9f7 57 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 144:ef7eb2e8f9f7 58 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 144:ef7eb2e8f9f7 59 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 144:ef7eb2e8f9f7 60 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 144:ef7eb2e8f9f7 61 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 144:ef7eb2e8f9f7 62 *
<> 156:95d6b41a828b 63 ******************************************************************************
<> 144:ef7eb2e8f9f7 64 */
<> 144:ef7eb2e8f9f7 65
<> 144:ef7eb2e8f9f7 66 /* Includes ------------------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 67 #include "stm32f0xx_hal.h"
<> 144:ef7eb2e8f9f7 68
<> 144:ef7eb2e8f9f7 69 /** @addtogroup STM32F0xx_HAL_Driver
<> 144:ef7eb2e8f9f7 70 * @{
<> 144:ef7eb2e8f9f7 71 */
<> 144:ef7eb2e8f9f7 72
<> 144:ef7eb2e8f9f7 73 /** @defgroup I2CEx I2CEx
<> 144:ef7eb2e8f9f7 74 * @brief I2C Extended HAL module driver
<> 144:ef7eb2e8f9f7 75 * @{
<> 144:ef7eb2e8f9f7 76 */
<> 144:ef7eb2e8f9f7 77
<> 144:ef7eb2e8f9f7 78 #ifdef HAL_I2C_MODULE_ENABLED
<> 144:ef7eb2e8f9f7 79
<> 144:ef7eb2e8f9f7 80 /* Private typedef -----------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 81 /* Private define ------------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 82 /* Private macro -------------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 83 /* Private variables ---------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 84 /* Private function prototypes -----------------------------------------------*/
<> 144:ef7eb2e8f9f7 85 /* Private functions ---------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 86
<> 144:ef7eb2e8f9f7 87 /** @defgroup I2CEx_Exported_Functions I2C Extended Exported Functions
<> 144:ef7eb2e8f9f7 88 * @{
<> 144:ef7eb2e8f9f7 89 */
<> 144:ef7eb2e8f9f7 90
<> 144:ef7eb2e8f9f7 91 /** @defgroup I2CEx_Exported_Functions_Group1 Extended features functions
<> 144:ef7eb2e8f9f7 92 * @brief Extended features functions
<> 156:95d6b41a828b 93 *
<> 156:95d6b41a828b 94 @verbatim
<> 144:ef7eb2e8f9f7 95 ===============================================================================
<> 144:ef7eb2e8f9f7 96 ##### Extended features functions #####
<> 156:95d6b41a828b 97 ===============================================================================
<> 144:ef7eb2e8f9f7 98 [..] This section provides functions allowing to:
<> 144:ef7eb2e8f9f7 99 (+) Configure Noise Filters
<> 144:ef7eb2e8f9f7 100 (+) Configure Wake Up Feature
<> 144:ef7eb2e8f9f7 101
<> 144:ef7eb2e8f9f7 102 @endverbatim
<> 144:ef7eb2e8f9f7 103 * @{
<> 144:ef7eb2e8f9f7 104 */
<> 156:95d6b41a828b 105
<> 144:ef7eb2e8f9f7 106 /**
<> 156:95d6b41a828b 107 * @brief Configure I2C Analog noise filter.
<> 144:ef7eb2e8f9f7 108 * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
<> 144:ef7eb2e8f9f7 109 * the configuration information for the specified I2Cx peripheral.
<> 144:ef7eb2e8f9f7 110 * @param AnalogFilter New state of the Analog filter.
<> 144:ef7eb2e8f9f7 111 * @retval HAL status
<> 144:ef7eb2e8f9f7 112 */
<> 144:ef7eb2e8f9f7 113 HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter)
<> 144:ef7eb2e8f9f7 114 {
<> 144:ef7eb2e8f9f7 115 /* Check the parameters */
<> 144:ef7eb2e8f9f7 116 assert_param(IS_I2C_ALL_INSTANCE(hi2c->Instance));
<> 144:ef7eb2e8f9f7 117 assert_param(IS_I2C_ANALOG_FILTER(AnalogFilter));
<> 156:95d6b41a828b 118
<> 144:ef7eb2e8f9f7 119 if(hi2c->State == HAL_I2C_STATE_READY)
<> 156:95d6b41a828b 120 {
<> 144:ef7eb2e8f9f7 121 /* Process Locked */
<> 144:ef7eb2e8f9f7 122 __HAL_LOCK(hi2c);
<> 156:95d6b41a828b 123
<> 144:ef7eb2e8f9f7 124 hi2c->State = HAL_I2C_STATE_BUSY;
<> 156:95d6b41a828b 125
<> 144:ef7eb2e8f9f7 126 /* Disable the selected I2C peripheral */
<> 156:95d6b41a828b 127 __HAL_I2C_DISABLE(hi2c);
<> 156:95d6b41a828b 128
<> 144:ef7eb2e8f9f7 129 /* Reset I2Cx ANOFF bit */
<> 156:95d6b41a828b 130 hi2c->Instance->CR1 &= ~(I2C_CR1_ANFOFF);
<> 156:95d6b41a828b 131
<> 144:ef7eb2e8f9f7 132 /* Set analog filter bit*/
<> 144:ef7eb2e8f9f7 133 hi2c->Instance->CR1 |= AnalogFilter;
<> 156:95d6b41a828b 134
<> 156:95d6b41a828b 135 __HAL_I2C_ENABLE(hi2c);
<> 156:95d6b41a828b 136
<> 144:ef7eb2e8f9f7 137 hi2c->State = HAL_I2C_STATE_READY;
<> 156:95d6b41a828b 138
<> 144:ef7eb2e8f9f7 139 /* Process Unlocked */
<> 144:ef7eb2e8f9f7 140 __HAL_UNLOCK(hi2c);
<> 156:95d6b41a828b 141
<> 156:95d6b41a828b 142 return HAL_OK;
<> 144:ef7eb2e8f9f7 143 }
<> 144:ef7eb2e8f9f7 144 else
<> 144:ef7eb2e8f9f7 145 {
<> 144:ef7eb2e8f9f7 146 return HAL_BUSY;
<> 144:ef7eb2e8f9f7 147 }
<> 144:ef7eb2e8f9f7 148 }
<> 144:ef7eb2e8f9f7 149
<> 144:ef7eb2e8f9f7 150 /**
<> 156:95d6b41a828b 151 * @brief Configure I2C Digital noise filter.
<> 144:ef7eb2e8f9f7 152 * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
<> 144:ef7eb2e8f9f7 153 * the configuration information for the specified I2Cx peripheral.
<> 156:95d6b41a828b 154 * @param DigitalFilter Coefficient of digital noise filter between Min_Data=0x00 and Max_Data=0x0F.
<> 144:ef7eb2e8f9f7 155 * @retval HAL status
<> 144:ef7eb2e8f9f7 156 */
<> 144:ef7eb2e8f9f7 157 HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter)
<> 144:ef7eb2e8f9f7 158 {
<> 144:ef7eb2e8f9f7 159 uint32_t tmpreg = 0U;
<> 156:95d6b41a828b 160
<> 144:ef7eb2e8f9f7 161 /* Check the parameters */
<> 144:ef7eb2e8f9f7 162 assert_param(IS_I2C_ALL_INSTANCE(hi2c->Instance));
<> 144:ef7eb2e8f9f7 163 assert_param(IS_I2C_DIGITAL_FILTER(DigitalFilter));
<> 156:95d6b41a828b 164
<> 144:ef7eb2e8f9f7 165 if(hi2c->State == HAL_I2C_STATE_READY)
<> 156:95d6b41a828b 166 {
<> 144:ef7eb2e8f9f7 167 /* Process Locked */
<> 144:ef7eb2e8f9f7 168 __HAL_LOCK(hi2c);
<> 156:95d6b41a828b 169
<> 144:ef7eb2e8f9f7 170 hi2c->State = HAL_I2C_STATE_BUSY;
<> 156:95d6b41a828b 171
<> 144:ef7eb2e8f9f7 172 /* Disable the selected I2C peripheral */
<> 156:95d6b41a828b 173 __HAL_I2C_DISABLE(hi2c);
<> 156:95d6b41a828b 174
<> 144:ef7eb2e8f9f7 175 /* Get the old register value */
<> 144:ef7eb2e8f9f7 176 tmpreg = hi2c->Instance->CR1;
<> 156:95d6b41a828b 177
<> 144:ef7eb2e8f9f7 178 /* Reset I2Cx DNF bits [11:8] */
<> 144:ef7eb2e8f9f7 179 tmpreg &= ~(I2C_CR1_DNF);
<> 156:95d6b41a828b 180
<> 144:ef7eb2e8f9f7 181 /* Set I2Cx DNF coefficient */
<> 144:ef7eb2e8f9f7 182 tmpreg |= DigitalFilter << 8U;
<> 156:95d6b41a828b 183
<> 144:ef7eb2e8f9f7 184 /* Store the new register value */
<> 144:ef7eb2e8f9f7 185 hi2c->Instance->CR1 = tmpreg;
<> 156:95d6b41a828b 186
<> 156:95d6b41a828b 187 __HAL_I2C_ENABLE(hi2c);
<> 156:95d6b41a828b 188
<> 144:ef7eb2e8f9f7 189 hi2c->State = HAL_I2C_STATE_READY;
<> 156:95d6b41a828b 190
<> 144:ef7eb2e8f9f7 191 /* Process Unlocked */
<> 144:ef7eb2e8f9f7 192 __HAL_UNLOCK(hi2c);
<> 156:95d6b41a828b 193
<> 144:ef7eb2e8f9f7 194 return HAL_OK;
<> 144:ef7eb2e8f9f7 195 }
<> 144:ef7eb2e8f9f7 196 else
<> 144:ef7eb2e8f9f7 197 {
<> 144:ef7eb2e8f9f7 198 return HAL_BUSY;
<> 144:ef7eb2e8f9f7 199 }
<> 156:95d6b41a828b 200 }
<> 156:95d6b41a828b 201 #if defined(I2C_CR1_WUPEN)
<> 144:ef7eb2e8f9f7 202
<> 144:ef7eb2e8f9f7 203 /**
<> 144:ef7eb2e8f9f7 204 * @brief Enable I2C wakeup from stop mode.
<> 144:ef7eb2e8f9f7 205 * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
<> 144:ef7eb2e8f9f7 206 * the configuration information for the specified I2Cx peripheral.
<> 144:ef7eb2e8f9f7 207 * @retval HAL status
<> 144:ef7eb2e8f9f7 208 */
<> 144:ef7eb2e8f9f7 209 HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp (I2C_HandleTypeDef *hi2c)
<> 144:ef7eb2e8f9f7 210 {
<> 144:ef7eb2e8f9f7 211 /* Check the parameters */
<> 144:ef7eb2e8f9f7 212 assert_param(IS_I2C_WAKEUP_FROMSTOP_INSTANCE(hi2c->Instance));
<> 156:95d6b41a828b 213
<> 144:ef7eb2e8f9f7 214 if(hi2c->State == HAL_I2C_STATE_READY)
<> 156:95d6b41a828b 215 {
<> 144:ef7eb2e8f9f7 216 /* Process Locked */
<> 144:ef7eb2e8f9f7 217 __HAL_LOCK(hi2c);
<> 156:95d6b41a828b 218
<> 144:ef7eb2e8f9f7 219 hi2c->State = HAL_I2C_STATE_BUSY;
<> 156:95d6b41a828b 220
<> 144:ef7eb2e8f9f7 221 /* Disable the selected I2C peripheral */
<> 156:95d6b41a828b 222 __HAL_I2C_DISABLE(hi2c);
<> 156:95d6b41a828b 223
<> 144:ef7eb2e8f9f7 224 /* Enable wakeup from stop mode */
<> 156:95d6b41a828b 225 hi2c->Instance->CR1 |= I2C_CR1_WUPEN;
<> 156:95d6b41a828b 226
<> 156:95d6b41a828b 227 __HAL_I2C_ENABLE(hi2c);
<> 156:95d6b41a828b 228
<> 144:ef7eb2e8f9f7 229 hi2c->State = HAL_I2C_STATE_READY;
<> 156:95d6b41a828b 230
<> 144:ef7eb2e8f9f7 231 /* Process Unlocked */
<> 144:ef7eb2e8f9f7 232 __HAL_UNLOCK(hi2c);
<> 156:95d6b41a828b 233
<> 144:ef7eb2e8f9f7 234 return HAL_OK;
<> 144:ef7eb2e8f9f7 235 }
<> 144:ef7eb2e8f9f7 236 else
<> 144:ef7eb2e8f9f7 237 {
<> 144:ef7eb2e8f9f7 238 return HAL_BUSY;
<> 144:ef7eb2e8f9f7 239 }
<> 156:95d6b41a828b 240 }
<> 144:ef7eb2e8f9f7 241
<> 144:ef7eb2e8f9f7 242 /**
<> 144:ef7eb2e8f9f7 243 * @brief Disable I2C wakeup from stop mode.
<> 144:ef7eb2e8f9f7 244 * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
<> 144:ef7eb2e8f9f7 245 * the configuration information for the specified I2Cx peripheral.
<> 144:ef7eb2e8f9f7 246 * @retval HAL status
<> 144:ef7eb2e8f9f7 247 */
<> 144:ef7eb2e8f9f7 248 HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp (I2C_HandleTypeDef *hi2c)
<> 144:ef7eb2e8f9f7 249 {
<> 144:ef7eb2e8f9f7 250 /* Check the parameters */
<> 144:ef7eb2e8f9f7 251 assert_param(IS_I2C_WAKEUP_FROMSTOP_INSTANCE(hi2c->Instance));
<> 156:95d6b41a828b 252
<> 144:ef7eb2e8f9f7 253 if(hi2c->State == HAL_I2C_STATE_READY)
<> 156:95d6b41a828b 254 {
<> 144:ef7eb2e8f9f7 255 /* Process Locked */
<> 144:ef7eb2e8f9f7 256 __HAL_LOCK(hi2c);
<> 156:95d6b41a828b 257
<> 144:ef7eb2e8f9f7 258 hi2c->State = HAL_I2C_STATE_BUSY;
<> 156:95d6b41a828b 259
<> 144:ef7eb2e8f9f7 260 /* Disable the selected I2C peripheral */
<> 156:95d6b41a828b 261 __HAL_I2C_DISABLE(hi2c);
<> 156:95d6b41a828b 262
<> 144:ef7eb2e8f9f7 263 /* Enable wakeup from stop mode */
<> 156:95d6b41a828b 264 hi2c->Instance->CR1 &= ~(I2C_CR1_WUPEN);
<> 156:95d6b41a828b 265
<> 144:ef7eb2e8f9f7 266 __HAL_I2C_ENABLE(hi2c);
<> 156:95d6b41a828b 267
<> 144:ef7eb2e8f9f7 268 hi2c->State = HAL_I2C_STATE_READY;
<> 156:95d6b41a828b 269
<> 144:ef7eb2e8f9f7 270 /* Process Unlocked */
<> 144:ef7eb2e8f9f7 271 __HAL_UNLOCK(hi2c);
<> 156:95d6b41a828b 272
<> 156:95d6b41a828b 273 return HAL_OK;
<> 144:ef7eb2e8f9f7 274 }
<> 144:ef7eb2e8f9f7 275 else
<> 144:ef7eb2e8f9f7 276 {
<> 144:ef7eb2e8f9f7 277 return HAL_BUSY;
<> 144:ef7eb2e8f9f7 278 }
<> 156:95d6b41a828b 279 }
<> 156:95d6b41a828b 280 #endif
<> 144:ef7eb2e8f9f7 281
<> 144:ef7eb2e8f9f7 282 /**
<> 144:ef7eb2e8f9f7 283 * @brief Enable the I2C fast mode plus driving capability.
<> 144:ef7eb2e8f9f7 284 * @param ConfigFastModePlus Selects the pin.
<> 144:ef7eb2e8f9f7 285 * This parameter can be one of the @ref I2CEx_FastModePlus values
<> 156:95d6b41a828b 286 * @note For I2C1, fast mode plus driving capability can be enabled on all selected
<> 156:95d6b41a828b 287 * I2C1 pins using I2C_FASTMODEPLUS_I2C1 parameter or independently
<> 156:95d6b41a828b 288 * on each one of the following pins PB6, PB7, PB8 and PB9.
<> 156:95d6b41a828b 289 * @note For remaining I2C1 pins (PA14, PA15...) fast mode plus driving capability
<> 156:95d6b41a828b 290 * can be enabled only by using I2C_FASTMODEPLUS_I2C1 parameter.
<> 156:95d6b41a828b 291 * @note For all I2C2 pins fast mode plus driving capability can be enabled
<> 156:95d6b41a828b 292 * only by using I2C_FASTMODEPLUS_I2C2 parameter.
<> 144:ef7eb2e8f9f7 293 * @retval None
<> 144:ef7eb2e8f9f7 294 */
<> 144:ef7eb2e8f9f7 295 void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus)
<> 144:ef7eb2e8f9f7 296 {
<> 144:ef7eb2e8f9f7 297 /* Check the parameter */
<> 144:ef7eb2e8f9f7 298 assert_param(IS_I2C_FASTMODEPLUS(ConfigFastModePlus));
<> 156:95d6b41a828b 299
<> 144:ef7eb2e8f9f7 300 /* Enable SYSCFG clock */
<> 144:ef7eb2e8f9f7 301 __HAL_RCC_SYSCFG_CLK_ENABLE();
<> 156:95d6b41a828b 302
<> 144:ef7eb2e8f9f7 303 /* Enable fast mode plus driving capability for selected pin */
<> 144:ef7eb2e8f9f7 304 SET_BIT(SYSCFG->CFGR1, (uint32_t)ConfigFastModePlus);
<> 144:ef7eb2e8f9f7 305 }
<> 144:ef7eb2e8f9f7 306
<> 144:ef7eb2e8f9f7 307 /**
<> 144:ef7eb2e8f9f7 308 * @brief Disable the I2C fast mode plus driving capability.
<> 144:ef7eb2e8f9f7 309 * @param ConfigFastModePlus Selects the pin.
<> 144:ef7eb2e8f9f7 310 * This parameter can be one of the @ref I2CEx_FastModePlus values
<> 156:95d6b41a828b 311 * @note For I2C1, fast mode plus driving capability can be disabled on all selected
<> 156:95d6b41a828b 312 * I2C1 pins using I2C_FASTMODEPLUS_I2C1 parameter or independently
<> 156:95d6b41a828b 313 * on each one of the following pins PB6, PB7, PB8 and PB9.
<> 156:95d6b41a828b 314 * @note For remaining I2C1 pins (PA14, PA15...) fast mode plus driving capability
<> 156:95d6b41a828b 315 * can be disabled only by using I2C_FASTMODEPLUS_I2C1 parameter.
<> 156:95d6b41a828b 316 * @note For all I2C2 pins fast mode plus driving capability can be disabled
<> 156:95d6b41a828b 317 * only by using I2C_FASTMODEPLUS_I2C2 parameter.
<> 144:ef7eb2e8f9f7 318 * @retval None
<> 144:ef7eb2e8f9f7 319 */
<> 144:ef7eb2e8f9f7 320 void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus)
<> 144:ef7eb2e8f9f7 321 {
<> 144:ef7eb2e8f9f7 322 /* Check the parameter */
<> 144:ef7eb2e8f9f7 323 assert_param(IS_I2C_FASTMODEPLUS(ConfigFastModePlus));
<> 156:95d6b41a828b 324
<> 144:ef7eb2e8f9f7 325 /* Enable SYSCFG clock */
<> 144:ef7eb2e8f9f7 326 __HAL_RCC_SYSCFG_CLK_ENABLE();
<> 144:ef7eb2e8f9f7 327
<> 144:ef7eb2e8f9f7 328 /* Disable fast mode plus driving capability for selected pin */
<> 144:ef7eb2e8f9f7 329 CLEAR_BIT(SYSCFG->CFGR1, (uint32_t)ConfigFastModePlus);
<> 144:ef7eb2e8f9f7 330 }
<> 144:ef7eb2e8f9f7 331
<> 144:ef7eb2e8f9f7 332 /**
<> 144:ef7eb2e8f9f7 333 * @}
<> 156:95d6b41a828b 334 */
<> 144:ef7eb2e8f9f7 335
<> 144:ef7eb2e8f9f7 336 /**
<> 144:ef7eb2e8f9f7 337 * @}
<> 144:ef7eb2e8f9f7 338 */
<> 144:ef7eb2e8f9f7 339
<> 144:ef7eb2e8f9f7 340 #endif /* HAL_I2C_MODULE_ENABLED */
<> 144:ef7eb2e8f9f7 341 /**
<> 144:ef7eb2e8f9f7 342 * @}
<> 144:ef7eb2e8f9f7 343 */
<> 144:ef7eb2e8f9f7 344
<> 144:ef7eb2e8f9f7 345 /**
<> 144:ef7eb2e8f9f7 346 * @}
<> 144:ef7eb2e8f9f7 347 */
<> 144:ef7eb2e8f9f7 348
<> 144:ef7eb2e8f9f7 349 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/