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.
stm32l4xx_hal_i2c_ex.h
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4xx_hal_i2c_ex.h 00004 * @author MCD Application Team 00005 * @version V1.5.1 00006 * @date 31-May-2016 00007 * @brief Header file of I2C HAL Extended module. 00008 ****************************************************************************** 00009 * @attention 00010 * 00011 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00012 * 00013 * Redistribution and use in source and binary forms, with or without modification, 00014 * are permitted provided that the following conditions are met: 00015 * 1. Redistributions of source code must retain the above copyright notice, 00016 * this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright notice, 00018 * this list of conditions and the following disclaimer in the documentation 00019 * and/or other materials provided with the distribution. 00020 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00021 * may be used to endorse or promote products derived from this software 00022 * without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00025 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00026 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00028 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00029 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00032 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 ****************************************************************************** 00036 */ 00037 00038 /* Define to prevent recursive inclusion -------------------------------------*/ 00039 #ifndef __STM32L4xx_HAL_I2C_EX_H 00040 #define __STM32L4xx_HAL_I2C_EX_H 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 /* Includes ------------------------------------------------------------------*/ 00047 #include "stm32l4xx_hal_def.h" 00048 00049 /** @addtogroup STM32L4xx_HAL_Driver 00050 * @{ 00051 */ 00052 00053 /** @addtogroup I2CEx I2CEx 00054 * @{ 00055 */ 00056 00057 /* Exported types ------------------------------------------------------------*/ 00058 /* Exported constants --------------------------------------------------------*/ 00059 00060 /** @defgroup I2CEx_Exported_Constants I2C Extended Exported Constants 00061 * @{ 00062 */ 00063 00064 /** @defgroup I2CEx_Analog_Filter I2C Extended Analog Filter 00065 * @{ 00066 */ 00067 #define I2C_ANALOGFILTER_ENABLE ((uint32_t)0x00000000) 00068 #define I2C_ANALOGFILTER_DISABLE I2C_CR1_ANFOFF 00069 /** 00070 * @} 00071 */ 00072 00073 /** @defgroup I2CEx_FastModePlus I2C Extended Fast Mode Plus 00074 * @{ 00075 */ 00076 #define I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */ 00077 #define I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */ 00078 #define I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */ 00079 #define I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */ 00080 #define I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */ 00081 #define I2C_FASTMODEPLUS_I2C2 SYSCFG_CFGR1_I2C2_FMP /*!< Enable Fast Mode Plus on I2C2 pins */ 00082 #define I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */ 00083 /** 00084 * @} 00085 */ 00086 00087 /** 00088 * @} 00089 */ 00090 00091 /* Exported macro ------------------------------------------------------------*/ 00092 /* Exported functions --------------------------------------------------------*/ 00093 00094 /** @addtogroup I2CEx_Exported_Functions I2C Extended Exported Functions 00095 * @{ 00096 */ 00097 00098 /** @addtogroup I2CEx_Exported_Functions_Group1 Extended features functions 00099 * @brief Extended features functions 00100 * @{ 00101 */ 00102 00103 /* Peripheral Control functions ************************************************/ 00104 HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); 00105 HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); 00106 HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c); 00107 HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c); 00108 void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); 00109 void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); 00110 00111 /* Private constants ---------------------------------------------------------*/ 00112 /** @defgroup I2CEx_Private_Constants I2C Extended Private Constants 00113 * @{ 00114 */ 00115 00116 /** 00117 * @} 00118 */ 00119 00120 /* Private macros ------------------------------------------------------------*/ 00121 /** @defgroup I2CEx_Private_Macro I2C Extended Private Macros 00122 * @{ 00123 */ 00124 #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ 00125 ((FILTER) == I2C_ANALOGFILTER_DISABLE)) 00126 00127 #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000F) 00128 00129 #if defined (STM32L432xx) || defined (STM32L442xx) 00130 #define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6) || \ 00131 (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7) || \ 00132 (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ 00133 (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3)) 00134 #else 00135 #define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6) || \ 00136 (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7) || \ 00137 (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8)) == I2C_FASTMODEPLUS_PB8) || \ 00138 (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9) || \ 00139 (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ 00140 (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2) || \ 00141 (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3)) 00142 #endif /* STM32L432xx || STM32L442xx */ 00143 /** 00144 * @} 00145 */ 00146 00147 /* Private Functions ---------------------------------------------------------*/ 00148 /** @defgroup I2CEx_Private_Functions I2C Extended Private Functions 00149 * @{ 00150 */ 00151 /* Private functions are defined in stm32l4xx_hal_i2c_ex.c file */ 00152 /** 00153 * @} 00154 */ 00155 00156 /** 00157 * @} 00158 */ 00159 00160 /** 00161 * @} 00162 */ 00163 00164 /** 00165 * @} 00166 */ 00167 00168 /** 00169 * @} 00170 */ 00171 00172 #ifdef __cplusplus 00173 } 00174 #endif 00175 00176 #endif /* __STM32L4xx_HAL_I2C_EX_H */ 00177 00178 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue Jul 12 2022 10:59:58 by
