mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Jul 02 16:30:08 2015 +0100
Revision:
581:39197bcd20f2
Parent:
532:fe11edbda85c
Child:
613:bc40b8d2aec4
Synchronized with git revision ae2d3cdffe70184eb8736d94f76c45c93f4b7724

Full URL: https://github.com/mbedmicro/mbed/commit/ae2d3cdffe70184eb8736d94f76c45c93f4b7724/

Make it possible to build the core mbed library with yotta

Who changed what in which revision?

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