Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_i2c_ex.h@188:60408c49b6d4, 2018-09-20 (annotated)
- Committer:
- WaleedElmughrabi
- Date:
- Thu Sep 20 16:11:23 2018 +0000
- Revision:
- 188:60408c49b6d4
- Parent:
- 186:707f6e361f3e
Fork modified for BG96 error
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 144:ef7eb2e8f9f7 | 1 | /** |
<> | 144:ef7eb2e8f9f7 | 2 | ****************************************************************************** |
<> | 144:ef7eb2e8f9f7 | 3 | * @file stm32f3xx_hal_i2c_ex.h |
<> | 144:ef7eb2e8f9f7 | 4 | * @author MCD Application Team |
<> | 144:ef7eb2e8f9f7 | 5 | * @brief Header file of I2C HAL Extended module. |
<> | 144:ef7eb2e8f9f7 | 6 | ****************************************************************************** |
<> | 144:ef7eb2e8f9f7 | 7 | * @attention |
<> | 144:ef7eb2e8f9f7 | 8 | * |
<> | 144:ef7eb2e8f9f7 | 9 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
<> | 144:ef7eb2e8f9f7 | 10 | * |
<> | 144:ef7eb2e8f9f7 | 11 | * Redistribution and use in source and binary forms, with or without modification, |
<> | 144:ef7eb2e8f9f7 | 12 | * are permitted provided that the following conditions are met: |
<> | 144:ef7eb2e8f9f7 | 13 | * 1. Redistributions of source code must retain the above copyright notice, |
<> | 144:ef7eb2e8f9f7 | 14 | * this list of conditions and the following disclaimer. |
<> | 144:ef7eb2e8f9f7 | 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
<> | 144:ef7eb2e8f9f7 | 16 | * this list of conditions and the following disclaimer in the documentation |
<> | 144:ef7eb2e8f9f7 | 17 | * and/or other materials provided with the distribution. |
<> | 144:ef7eb2e8f9f7 | 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
<> | 144:ef7eb2e8f9f7 | 19 | * may be used to endorse or promote products derived from this software |
<> | 144:ef7eb2e8f9f7 | 20 | * without specific prior written permission. |
<> | 144:ef7eb2e8f9f7 | 21 | * |
<> | 144:ef7eb2e8f9f7 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
<> | 144:ef7eb2e8f9f7 | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
<> | 144:ef7eb2e8f9f7 | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
<> | 144:ef7eb2e8f9f7 | 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
<> | 144:ef7eb2e8f9f7 | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
<> | 144:ef7eb2e8f9f7 | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
<> | 144:ef7eb2e8f9f7 | 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
<> | 144:ef7eb2e8f9f7 | 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
<> | 144:ef7eb2e8f9f7 | 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
<> | 144:ef7eb2e8f9f7 | 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
<> | 144:ef7eb2e8f9f7 | 32 | * |
<> | 144:ef7eb2e8f9f7 | 33 | ****************************************************************************** |
<> | 157:ff67d9f36b67 | 34 | */ |
<> | 144:ef7eb2e8f9f7 | 35 | |
<> | 144:ef7eb2e8f9f7 | 36 | /* Define to prevent recursive inclusion -------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 37 | #ifndef __STM32F3xx_HAL_I2C_EX_H |
<> | 144:ef7eb2e8f9f7 | 38 | #define __STM32F3xx_HAL_I2C_EX_H |
<> | 144:ef7eb2e8f9f7 | 39 | |
<> | 144:ef7eb2e8f9f7 | 40 | #ifdef __cplusplus |
Anna Bridge |
186:707f6e361f3e | 41 | extern "C" { |
<> | 144:ef7eb2e8f9f7 | 42 | #endif |
<> | 144:ef7eb2e8f9f7 | 43 | |
<> | 144:ef7eb2e8f9f7 | 44 | /* Includes ------------------------------------------------------------------*/ |
<> | 157:ff67d9f36b67 | 45 | #include "stm32f3xx_hal_def.h" |
<> | 144:ef7eb2e8f9f7 | 46 | |
<> | 144:ef7eb2e8f9f7 | 47 | /** @addtogroup STM32F3xx_HAL_Driver |
<> | 144:ef7eb2e8f9f7 | 48 | * @{ |
<> | 144:ef7eb2e8f9f7 | 49 | */ |
<> | 144:ef7eb2e8f9f7 | 50 | |
<> | 157:ff67d9f36b67 | 51 | /** @addtogroup I2CEx |
<> | 144:ef7eb2e8f9f7 | 52 | * @{ |
Anna Bridge |
186:707f6e361f3e | 53 | */ |
<> | 144:ef7eb2e8f9f7 | 54 | |
<> | 157:ff67d9f36b67 | 55 | /* Exported types ------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 56 | /* Exported constants --------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 57 | |
<> | 144:ef7eb2e8f9f7 | 58 | /** @defgroup I2CEx_Exported_Constants I2C Extended Exported Constants |
<> | 144:ef7eb2e8f9f7 | 59 | * @{ |
<> | 144:ef7eb2e8f9f7 | 60 | */ |
<> | 144:ef7eb2e8f9f7 | 61 | |
<> | 144:ef7eb2e8f9f7 | 62 | /** @defgroup I2CEx_Analog_Filter I2C Extended Analog Filter |
<> | 144:ef7eb2e8f9f7 | 63 | * @{ |
<> | 144:ef7eb2e8f9f7 | 64 | */ |
<> | 157:ff67d9f36b67 | 65 | #define I2C_ANALOGFILTER_ENABLE 0x00000000U |
<> | 157:ff67d9f36b67 | 66 | #define I2C_ANALOGFILTER_DISABLE I2C_CR1_ANFOFF |
<> | 144:ef7eb2e8f9f7 | 67 | /** |
<> | 144:ef7eb2e8f9f7 | 68 | * @} |
<> | 144:ef7eb2e8f9f7 | 69 | */ |
<> | 144:ef7eb2e8f9f7 | 70 | |
<> | 144:ef7eb2e8f9f7 | 71 | /** @defgroup I2CEx_FastModePlus I2C Extended Fast Mode Plus |
<> | 144:ef7eb2e8f9f7 | 72 | * @{ |
<> | 144:ef7eb2e8f9f7 | 73 | */ |
<> | 157:ff67d9f36b67 | 74 | #define I2C_FMP_NOT_SUPPORTED 0xAAAA0000U /*!< Fast Mode Plus not supported */ |
<> | 157:ff67d9f36b67 | 75 | #define I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */ |
<> | 157:ff67d9f36b67 | 76 | #define I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */ |
<> | 157:ff67d9f36b67 | 77 | #define I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */ |
<> | 157:ff67d9f36b67 | 78 | #define I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */ |
<> | 157:ff67d9f36b67 | 79 | #define I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */ |
<> | 144:ef7eb2e8f9f7 | 80 | #if defined(SYSCFG_CFGR1_I2C2_FMP) |
<> | 157:ff67d9f36b67 | 81 | #define I2C_FASTMODEPLUS_I2C2 SYSCFG_CFGR1_I2C2_FMP /*!< Enable Fast Mode Plus on I2C2 pins */ |
<> | 157:ff67d9f36b67 | 82 | #else |
<> | 157:ff67d9f36b67 | 83 | #define I2C_FASTMODEPLUS_I2C2 (uint32_t)(0x00000200U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C2 not supported */ |
<> | 157:ff67d9f36b67 | 84 | #endif |
<> | 144:ef7eb2e8f9f7 | 85 | #if defined(SYSCFG_CFGR1_I2C3_FMP) |
<> | 157:ff67d9f36b67 | 86 | #define I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */ |
<> | 157:ff67d9f36b67 | 87 | #else |
<> | 157:ff67d9f36b67 | 88 | #define I2C_FASTMODEPLUS_I2C3 (uint32_t)(0x00000400U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C3 not supported */ |
<> | 157:ff67d9f36b67 | 89 | #endif |
<> | 144:ef7eb2e8f9f7 | 90 | /** |
<> | 144:ef7eb2e8f9f7 | 91 | * @} |
<> | 144:ef7eb2e8f9f7 | 92 | */ |
<> | 157:ff67d9f36b67 | 93 | |
<> | 144:ef7eb2e8f9f7 | 94 | /** |
<> | 144:ef7eb2e8f9f7 | 95 | * @} |
Anna Bridge |
186:707f6e361f3e | 96 | */ |
<> | 157:ff67d9f36b67 | 97 | |
<> | 144:ef7eb2e8f9f7 | 98 | /* Exported macro ------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 99 | /* Exported functions --------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 100 | |
<> | 144:ef7eb2e8f9f7 | 101 | /** @addtogroup I2CEx_Exported_Functions I2C Extended Exported Functions |
<> | 144:ef7eb2e8f9f7 | 102 | * @{ |
<> | 144:ef7eb2e8f9f7 | 103 | */ |
<> | 144:ef7eb2e8f9f7 | 104 | |
<> | 144:ef7eb2e8f9f7 | 105 | /** @addtogroup I2CEx_Exported_Functions_Group1 Extended features functions |
<> | 144:ef7eb2e8f9f7 | 106 | * @brief Extended features functions |
<> | 144:ef7eb2e8f9f7 | 107 | * @{ |
<> | 144:ef7eb2e8f9f7 | 108 | */ |
<> | 157:ff67d9f36b67 | 109 | |
<> | 144:ef7eb2e8f9f7 | 110 | /* Peripheral Control functions ************************************************/ |
<> | 144:ef7eb2e8f9f7 | 111 | HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); |
<> | 144:ef7eb2e8f9f7 | 112 | HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); |
<> | 157:ff67d9f36b67 | 113 | HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c); |
<> | 157:ff67d9f36b67 | 114 | HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c); |
<> | 144:ef7eb2e8f9f7 | 115 | void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); |
<> | 144:ef7eb2e8f9f7 | 116 | void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); |
<> | 144:ef7eb2e8f9f7 | 117 | |
<> | 144:ef7eb2e8f9f7 | 118 | /* Private constants ---------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 119 | /** @defgroup I2CEx_Private_Constants I2C Extended Private Constants |
<> | 144:ef7eb2e8f9f7 | 120 | * @{ |
<> | 144:ef7eb2e8f9f7 | 121 | */ |
<> | 144:ef7eb2e8f9f7 | 122 | |
<> | 144:ef7eb2e8f9f7 | 123 | /** |
<> | 144:ef7eb2e8f9f7 | 124 | * @} |
<> | 157:ff67d9f36b67 | 125 | */ |
<> | 144:ef7eb2e8f9f7 | 126 | |
<> | 144:ef7eb2e8f9f7 | 127 | /* Private macros ------------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 128 | /** @defgroup I2CEx_Private_Macro I2C Extended Private Macros |
<> | 144:ef7eb2e8f9f7 | 129 | * @{ |
<> | 144:ef7eb2e8f9f7 | 130 | */ |
<> | 144:ef7eb2e8f9f7 | 131 | #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ |
<> | 157:ff67d9f36b67 | 132 | ((FILTER) == I2C_ANALOGFILTER_DISABLE)) |
<> | 144:ef7eb2e8f9f7 | 133 | |
<> | 157:ff67d9f36b67 | 134 | #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU) |
<> | 144:ef7eb2e8f9f7 | 135 | |
<> | 157:ff67d9f36b67 | 136 | #define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & I2C_FMP_NOT_SUPPORTED) != I2C_FMP_NOT_SUPPORTED) && \ |
<> | 157:ff67d9f36b67 | 137 | ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6) || \ |
<> | 157:ff67d9f36b67 | 138 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7) || \ |
<> | 157:ff67d9f36b67 | 139 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8)) == I2C_FASTMODEPLUS_PB8) || \ |
<> | 157:ff67d9f36b67 | 140 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9) || \ |
<> | 157:ff67d9f36b67 | 141 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ |
<> | 157:ff67d9f36b67 | 142 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2) || \ |
<> | 157:ff67d9f36b67 | 143 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3))) |
<> | 144:ef7eb2e8f9f7 | 144 | /** |
<> | 144:ef7eb2e8f9f7 | 145 | * @} |
Anna Bridge |
186:707f6e361f3e | 146 | */ |
<> | 157:ff67d9f36b67 | 147 | |
<> | 144:ef7eb2e8f9f7 | 148 | /* Private Functions ---------------------------------------------------------*/ |
<> | 144:ef7eb2e8f9f7 | 149 | /** @defgroup I2CEx_Private_Functions I2C Extended Private Functions |
<> | 144:ef7eb2e8f9f7 | 150 | * @{ |
<> | 157:ff67d9f36b67 | 151 | */ |
<> | 144:ef7eb2e8f9f7 | 152 | /* Private functions are defined in stm32f3xx_hal_i2c_ex.c file */ |
<> | 144:ef7eb2e8f9f7 | 153 | /** |
<> | 144:ef7eb2e8f9f7 | 154 | * @} |
<> | 144:ef7eb2e8f9f7 | 155 | */ |
<> | 144:ef7eb2e8f9f7 | 156 | |
<> | 144:ef7eb2e8f9f7 | 157 | /** |
<> | 144:ef7eb2e8f9f7 | 158 | * @} |
<> | 144:ef7eb2e8f9f7 | 159 | */ |
<> | 144:ef7eb2e8f9f7 | 160 | |
<> | 157:ff67d9f36b67 | 161 | /** |
<> | 157:ff67d9f36b67 | 162 | * @} |
<> | 157:ff67d9f36b67 | 163 | */ |
<> | 157:ff67d9f36b67 | 164 | |
<> | 157:ff67d9f36b67 | 165 | /** |
<> | 157:ff67d9f36b67 | 166 | * @} |
<> | 157:ff67d9f36b67 | 167 | */ |
<> | 157:ff67d9f36b67 | 168 | |
<> | 157:ff67d9f36b67 | 169 | /** |
<> | 157:ff67d9f36b67 | 170 | * @} |
<> | 157:ff67d9f36b67 | 171 | */ |
<> | 144:ef7eb2e8f9f7 | 172 | |
<> | 144:ef7eb2e8f9f7 | 173 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 174 | } |
<> | 144:ef7eb2e8f9f7 | 175 | #endif |
<> | 144:ef7eb2e8f9f7 | 176 | |
<> | 144:ef7eb2e8f9f7 | 177 | #endif /* __STM32F3xx_HAL_I2C_EX_H */ |
<> | 144:ef7eb2e8f9f7 | 178 | |
<> | 144:ef7eb2e8f9f7 | 179 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |