The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_NUCLEO_F030R8/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_i2c_ex.h@143:86740a56073b, 2017-05-26 (annotated)
- Committer:
- AnnaBridge
- Date:
- Fri May 26 12:30:20 2017 +0100
- Revision:
- 143:86740a56073b
- Parent:
- 134:ad3be0349dc5
Release 143 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 85:024bf7f99721 | 1 | /** |
bogdanm | 85:024bf7f99721 | 2 | ****************************************************************************** |
bogdanm | 85:024bf7f99721 | 3 | * @file stm32f0xx_hal_i2c_ex.h |
bogdanm | 85:024bf7f99721 | 4 | * @author MCD Application Team |
<> | 134:ad3be0349dc5 | 5 | * @version V1.5.0 |
<> | 134:ad3be0349dc5 | 6 | * @date 04-November-2016 |
Kojto | 108:34e6b704fe68 | 7 | * @brief Header file of I2C HAL Extended module. |
bogdanm | 85:024bf7f99721 | 8 | ****************************************************************************** |
bogdanm | 85:024bf7f99721 | 9 | * @attention |
bogdanm | 85:024bf7f99721 | 10 | * |
Kojto | 122:f9eeca106725 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
bogdanm | 85:024bf7f99721 | 12 | * |
bogdanm | 85:024bf7f99721 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 85:024bf7f99721 | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 85:024bf7f99721 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 85:024bf7f99721 | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 85:024bf7f99721 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 85:024bf7f99721 | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 85:024bf7f99721 | 19 | * and/or other materials provided with the distribution. |
bogdanm | 85:024bf7f99721 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 85:024bf7f99721 | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 85:024bf7f99721 | 22 | * without specific prior written permission. |
bogdanm | 85:024bf7f99721 | 23 | * |
bogdanm | 85:024bf7f99721 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 85:024bf7f99721 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 85:024bf7f99721 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 85:024bf7f99721 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 85:024bf7f99721 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 85:024bf7f99721 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 85:024bf7f99721 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 85:024bf7f99721 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 85:024bf7f99721 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 85:024bf7f99721 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 85:024bf7f99721 | 34 | * |
bogdanm | 85:024bf7f99721 | 35 | ****************************************************************************** |
<> | 134:ad3be0349dc5 | 36 | */ |
bogdanm | 85:024bf7f99721 | 37 | |
bogdanm | 85:024bf7f99721 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 39 | #ifndef __STM32F0xx_HAL_I2C_EX_H |
bogdanm | 85:024bf7f99721 | 40 | #define __STM32F0xx_HAL_I2C_EX_H |
bogdanm | 85:024bf7f99721 | 41 | |
bogdanm | 85:024bf7f99721 | 42 | #ifdef __cplusplus |
bogdanm | 85:024bf7f99721 | 43 | extern "C" { |
bogdanm | 85:024bf7f99721 | 44 | #endif |
bogdanm | 85:024bf7f99721 | 45 | |
bogdanm | 85:024bf7f99721 | 46 | /* Includes ------------------------------------------------------------------*/ |
<> | 134:ad3be0349dc5 | 47 | #include "stm32f0xx_hal_def.h" |
bogdanm | 85:024bf7f99721 | 48 | |
bogdanm | 85:024bf7f99721 | 49 | /** @addtogroup STM32F0xx_HAL_Driver |
bogdanm | 85:024bf7f99721 | 50 | * @{ |
bogdanm | 85:024bf7f99721 | 51 | */ |
bogdanm | 85:024bf7f99721 | 52 | |
Kojto | 122:f9eeca106725 | 53 | /** @addtogroup I2CEx |
bogdanm | 85:024bf7f99721 | 54 | * @{ |
bogdanm | 85:024bf7f99721 | 55 | */ |
bogdanm | 85:024bf7f99721 | 56 | |
<> | 134:ad3be0349dc5 | 57 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 58 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 59 | |
Kojto | 122:f9eeca106725 | 60 | /** @defgroup I2CEx_Exported_Constants I2C Extended Exported Constants |
bogdanm | 85:024bf7f99721 | 61 | * @{ |
bogdanm | 85:024bf7f99721 | 62 | */ |
bogdanm | 85:024bf7f99721 | 63 | |
Kojto | 122:f9eeca106725 | 64 | /** @defgroup I2CEx_Analog_Filter I2C Extended Analog Filter |
bogdanm | 85:024bf7f99721 | 65 | * @{ |
bogdanm | 85:024bf7f99721 | 66 | */ |
Kojto | 122:f9eeca106725 | 67 | #define I2C_ANALOGFILTER_ENABLE (0x00000000U) |
Kojto | 108:34e6b704fe68 | 68 | #define I2C_ANALOGFILTER_DISABLE I2C_CR1_ANFOFF |
bogdanm | 85:024bf7f99721 | 69 | /** |
bogdanm | 85:024bf7f99721 | 70 | * @} |
bogdanm | 85:024bf7f99721 | 71 | */ |
bogdanm | 85:024bf7f99721 | 72 | |
<> | 134:ad3be0349dc5 | 73 | /** @defgroup I2CEx_FastModePlus I2C Extended Fast Mode Plus |
bogdanm | 85:024bf7f99721 | 74 | * @{ |
bogdanm | 85:024bf7f99721 | 75 | */ |
<> | 134:ad3be0349dc5 | 76 | #define I2C_FMP_NOT_SUPPORTED (0xAAAA0000U) /*!< Fast Mode Plus not supported */ |
<> | 134:ad3be0349dc5 | 77 | #if defined(SYSCFG_CFGR1_I2C_FMP_PA9) |
<> | 134:ad3be0349dc5 | 78 | #define I2C_FASTMODEPLUS_PA9 SYSCFG_CFGR1_I2C_FMP_PA9 /*!< Enable Fast Mode Plus on PA9 */ |
<> | 134:ad3be0349dc5 | 79 | #define I2C_FASTMODEPLUS_PA10 SYSCFG_CFGR1_I2C_FMP_PA10 /*!< Enable Fast Mode Plus on PA10 */ |
<> | 134:ad3be0349dc5 | 80 | #else |
<> | 134:ad3be0349dc5 | 81 | #define I2C_FASTMODEPLUS_PA9 (uint32_t)(0x00000001U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus PA9 not supported */ |
<> | 134:ad3be0349dc5 | 82 | #define I2C_FASTMODEPLUS_PA10 (uint32_t)(0x00000002U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus PA10 not supported */ |
<> | 134:ad3be0349dc5 | 83 | #endif |
<> | 134:ad3be0349dc5 | 84 | #define I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_FMP_PB6 /*!< Enable Fast Mode Plus on PB6 */ |
<> | 134:ad3be0349dc5 | 85 | #define I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_FMP_PB7 /*!< Enable Fast Mode Plus on PB7 */ |
<> | 134:ad3be0349dc5 | 86 | #define I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_FMP_PB8 /*!< Enable Fast Mode Plus on PB8 */ |
<> | 134:ad3be0349dc5 | 87 | #define I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_FMP_PB9 /*!< Enable Fast Mode Plus on PB9 */ |
<> | 134:ad3be0349dc5 | 88 | #if defined(SYSCFG_CFGR1_I2C_FMP_I2C1) |
<> | 134:ad3be0349dc5 | 89 | #define I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C_FMP_I2C1 /*!< Enable Fast Mode Plus on I2C1 pins */ |
<> | 134:ad3be0349dc5 | 90 | #else |
<> | 134:ad3be0349dc5 | 91 | #define I2C_FASTMODEPLUS_I2C1 (uint32_t)(0x00000100U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C1 not supported */ |
<> | 134:ad3be0349dc5 | 92 | #endif |
<> | 134:ad3be0349dc5 | 93 | #if defined(SYSCFG_CFGR1_I2C_FMP_I2C2) |
<> | 134:ad3be0349dc5 | 94 | #define I2C_FASTMODEPLUS_I2C2 SYSCFG_CFGR1_I2C_FMP_I2C2 /*!< Enable Fast Mode Plus on I2C2 pins */ |
<> | 134:ad3be0349dc5 | 95 | #else |
<> | 134:ad3be0349dc5 | 96 | #define I2C_FASTMODEPLUS_I2C2 (uint32_t)(0x00000200U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C2 not supported */ |
Kojto | 108:34e6b704fe68 | 97 | #endif |
bogdanm | 85:024bf7f99721 | 98 | /** |
bogdanm | 85:024bf7f99721 | 99 | * @} |
bogdanm | 85:024bf7f99721 | 100 | */ |
<> | 134:ad3be0349dc5 | 101 | |
bogdanm | 85:024bf7f99721 | 102 | /** |
bogdanm | 85:024bf7f99721 | 103 | * @} |
bogdanm | 85:024bf7f99721 | 104 | */ |
<> | 134:ad3be0349dc5 | 105 | |
bogdanm | 85:024bf7f99721 | 106 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 107 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 85:024bf7f99721 | 108 | |
Kojto | 122:f9eeca106725 | 109 | /** @addtogroup I2CEx_Exported_Functions I2C Extended Exported Functions |
bogdanm | 92:4fc01daae5a5 | 110 | * @{ |
bogdanm | 92:4fc01daae5a5 | 111 | */ |
bogdanm | 92:4fc01daae5a5 | 112 | |
bogdanm | 92:4fc01daae5a5 | 113 | /** @addtogroup I2CEx_Exported_Functions_Group1 Extended features functions |
bogdanm | 92:4fc01daae5a5 | 114 | * @brief Extended features functions |
bogdanm | 92:4fc01daae5a5 | 115 | * @{ |
bogdanm | 92:4fc01daae5a5 | 116 | */ |
<> | 134:ad3be0349dc5 | 117 | |
bogdanm | 85:024bf7f99721 | 118 | /* Peripheral Control functions ************************************************/ |
Kojto | 108:34e6b704fe68 | 119 | HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); |
Kojto | 108:34e6b704fe68 | 120 | HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); |
<> | 134:ad3be0349dc5 | 121 | #if defined(I2C_CR1_WUPEN) |
<> | 134:ad3be0349dc5 | 122 | HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c); |
<> | 134:ad3be0349dc5 | 123 | HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c); |
<> | 134:ad3be0349dc5 | 124 | #endif |
Kojto | 108:34e6b704fe68 | 125 | void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); |
Kojto | 108:34e6b704fe68 | 126 | void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); |
Kojto | 108:34e6b704fe68 | 127 | |
Kojto | 108:34e6b704fe68 | 128 | /* Private constants ---------------------------------------------------------*/ |
<> | 134:ad3be0349dc5 | 129 | /** @defgroup I2CEx_Private_Constants I2C Extended Private Constants |
Kojto | 108:34e6b704fe68 | 130 | * @{ |
Kojto | 108:34e6b704fe68 | 131 | */ |
bogdanm | 85:024bf7f99721 | 132 | |
bogdanm | 85:024bf7f99721 | 133 | /** |
bogdanm | 85:024bf7f99721 | 134 | * @} |
<> | 134:ad3be0349dc5 | 135 | */ |
bogdanm | 85:024bf7f99721 | 136 | |
Kojto | 108:34e6b704fe68 | 137 | /* Private macros ------------------------------------------------------------*/ |
<> | 134:ad3be0349dc5 | 138 | /** @defgroup I2CEx_Private_Macro I2C Extended Private Macros |
Kojto | 108:34e6b704fe68 | 139 | * @{ |
Kojto | 108:34e6b704fe68 | 140 | */ |
Kojto | 108:34e6b704fe68 | 141 | #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ |
<> | 134:ad3be0349dc5 | 142 | ((FILTER) == I2C_ANALOGFILTER_DISABLE)) |
Kojto | 108:34e6b704fe68 | 143 | |
Kojto | 122:f9eeca106725 | 144 | #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU) |
Kojto | 108:34e6b704fe68 | 145 | |
<> | 134:ad3be0349dc5 | 146 | #define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & I2C_FMP_NOT_SUPPORTED) != I2C_FMP_NOT_SUPPORTED) && \ |
<> | 134:ad3be0349dc5 | 147 | ((((__CONFIG__) & (I2C_FASTMODEPLUS_PA9)) == I2C_FASTMODEPLUS_PA9) || \ |
<> | 134:ad3be0349dc5 | 148 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PA10)) == I2C_FASTMODEPLUS_PA10) || \ |
<> | 134:ad3be0349dc5 | 149 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6) || \ |
<> | 134:ad3be0349dc5 | 150 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7) || \ |
<> | 134:ad3be0349dc5 | 151 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8)) == I2C_FASTMODEPLUS_PB8) || \ |
<> | 134:ad3be0349dc5 | 152 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9) || \ |
<> | 134:ad3be0349dc5 | 153 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ |
<> | 134:ad3be0349dc5 | 154 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2))) |
<> | 134:ad3be0349dc5 | 155 | /** |
<> | 134:ad3be0349dc5 | 156 | * @} |
<> | 134:ad3be0349dc5 | 157 | */ |
<> | 134:ad3be0349dc5 | 158 | |
<> | 134:ad3be0349dc5 | 159 | /* Private Functions ---------------------------------------------------------*/ |
<> | 134:ad3be0349dc5 | 160 | /** @defgroup I2CEx_Private_Functions I2C Extended Private Functions |
<> | 134:ad3be0349dc5 | 161 | * @{ |
<> | 134:ad3be0349dc5 | 162 | */ |
<> | 134:ad3be0349dc5 | 163 | /* Private functions are defined in stm32f0xx_hal_i2c_ex.c file */ |
Kojto | 108:34e6b704fe68 | 164 | /** |
Kojto | 108:34e6b704fe68 | 165 | * @} |
Kojto | 108:34e6b704fe68 | 166 | */ |
bogdanm | 92:4fc01daae5a5 | 167 | |
bogdanm | 92:4fc01daae5a5 | 168 | /** |
bogdanm | 92:4fc01daae5a5 | 169 | * @} |
bogdanm | 85:024bf7f99721 | 170 | */ |
bogdanm | 92:4fc01daae5a5 | 171 | |
bogdanm | 92:4fc01daae5a5 | 172 | /** |
bogdanm | 92:4fc01daae5a5 | 173 | * @} |
bogdanm | 92:4fc01daae5a5 | 174 | */ |
Kojto | 108:34e6b704fe68 | 175 | |
Kojto | 108:34e6b704fe68 | 176 | /** |
Kojto | 108:34e6b704fe68 | 177 | * @} |
Kojto | 108:34e6b704fe68 | 178 | */ |
Kojto | 108:34e6b704fe68 | 179 | |
Kojto | 108:34e6b704fe68 | 180 | /** |
Kojto | 108:34e6b704fe68 | 181 | * @} |
Kojto | 108:34e6b704fe68 | 182 | */ |
Kojto | 108:34e6b704fe68 | 183 | |
bogdanm | 85:024bf7f99721 | 184 | #ifdef __cplusplus |
bogdanm | 85:024bf7f99721 | 185 | } |
bogdanm | 85:024bf7f99721 | 186 | #endif |
bogdanm | 85:024bf7f99721 | 187 | |
bogdanm | 85:024bf7f99721 | 188 | #endif /* __STM32F0xx_HAL_I2C_EX_H */ |
bogdanm | 85:024bf7f99721 | 189 | |
bogdanm | 85:024bf7f99721 | 190 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |