1 /** 2 ****************************************************************************** 3 * @file stm32f4xx_hal_fmpi2c_ex.h 4 * @author MCD Application Team 5 * @brief Header file of FMPI2C HAL Extended module. 6 ****************************************************************************** 7 * @attention 8 * 9 * <h2><center>© Copyright (c) 2016 STMicroelectronics. 10 * All rights reserved.</center></h2> 11 * 12 * This software component is licensed by ST under BSD 3-Clause license, 13 * the "License"; You may not use this file except in compliance with the 14 * License. You may obtain a copy of the License at: 15 * opensource.org/licenses/BSD-3-Clause 16 * 17 ****************************************************************************** 18 */ 19 20 /* Define to prevent recursive inclusion -------------------------------------*/ 21 #ifndef STM32F4xx_HAL_FMPI2C_EX_H 22 #define STM32F4xx_HAL_FMPI2C_EX_H 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 #if defined(FMPI2C_CR1_PE) 29 /* Includes ------------------------------------------------------------------*/ 30 #include "stm32f4xx_hal_def.h" 31 32 /** @addtogroup STM32F4xx_HAL_Driver 33 * @{ 34 */ 35 36 /** @addtogroup FMPI2CEx 37 * @{ 38 */ 39 40 /* Exported types ------------------------------------------------------------*/ 41 /* Exported constants --------------------------------------------------------*/ 42 /** @defgroup FMPI2CEx_Exported_Constants FMPI2C Extended Exported Constants 43 * @{ 44 */ 45 46 /** @defgroup FMPI2CEx_Analog_Filter FMPI2C Extended Analog Filter 47 * @{ 48 */ 49 #define FMPI2C_ANALOGFILTER_ENABLE 0x00000000U 50 #define FMPI2C_ANALOGFILTER_DISABLE FMPI2C_CR1_ANFOFF 51 /** 52 * @} 53 */ 54 55 /** @defgroup FMPI2CEx_FastModePlus FMPI2C Extended Fast Mode Plus 56 * @{ 57 */ 58 #define FMPI2C_FASTMODEPLUS_SCL SYSCFG_CFGR_FMPI2C1_SCL /*!< Enable Fast Mode Plus on FMPI2C1 SCL pins */ 59 #define FMPI2C_FASTMODEPLUS_SDA SYSCFG_CFGR_FMPI2C1_SDA /*!< Enable Fast Mode Plus on FMPI2C1 SDA pins */ 60 /** 61 * @} 62 */ 63 64 /** 65 * @} 66 */ 67 68 /* Exported macro ------------------------------------------------------------*/ 69 /** @defgroup FMPI2CEx_Exported_Macros FMPI2C Extended Exported Macros 70 * @{ 71 */ 72 73 /** 74 * @} 75 */ 76 77 /* Exported functions --------------------------------------------------------*/ 78 /** @addtogroup FMPI2CEx_Exported_Functions FMPI2C Extended Exported Functions 79 * @{ 80 */ 81 82 /** @addtogroup FMPI2CEx_Exported_Functions_Group1 Filter Mode Functions 83 * @{ 84 */ 85 /* Peripheral Control functions ************************************************/ 86 HAL_StatusTypeDef HAL_FMPI2CEx_ConfigAnalogFilter(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t AnalogFilter); 87 HAL_StatusTypeDef HAL_FMPI2CEx_ConfigDigitalFilter(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t DigitalFilter); 88 /** 89 * @} 90 */ 91 92 /** @addtogroup FMPI2CEx_Exported_Functions_Group3 Fast Mode Plus Functions 93 * @{ 94 */ 95 void HAL_FMPI2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); 96 void HAL_FMPI2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); 97 /** 98 * @} 99 */ 100 101 /** 102 * @} 103 */ 104 105 /* Private constants ---------------------------------------------------------*/ 106 /** @defgroup FMPI2CEx_Private_Constants FMPI2C Extended Private Constants 107 * @{ 108 */ 109 110 /** 111 * @} 112 */ 113 114 /* Private macros ------------------------------------------------------------*/ 115 /** @defgroup FMPI2CEx_Private_Macro FMPI2C Extended Private Macros 116 * @{ 117 */ 118 #define IS_FMPI2C_ANALOG_FILTER(FILTER) (((FILTER) == FMPI2C_ANALOGFILTER_ENABLE) || \ 119 ((FILTER) == FMPI2C_ANALOGFILTER_DISABLE)) 120 121 #define IS_FMPI2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU) 122 123 #define IS_FMPI2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (FMPI2C_FASTMODEPLUS_SCL)) == FMPI2C_FASTMODEPLUS_SCL) || \ 124 (((__CONFIG__) & (FMPI2C_FASTMODEPLUS_SDA)) == FMPI2C_FASTMODEPLUS_SDA)) 125 /** 126 * @} 127 */ 128 129 /* Private Functions ---------------------------------------------------------*/ 130 /** @defgroup FMPI2CEx_Private_Functions FMPI2C Extended Private Functions 131 * @{ 132 */ 133 /* Private functions are defined in stm32f4xx_hal_fmpi2c_ex.c file */ 134 /** 135 * @} 136 */ 137 138 /** 139 * @} 140 */ 141 142 /** 143 * @} 144 */ 145 146 #endif /* FMPI2C_CR1_PE */ 147 #ifdef __cplusplus 148 } 149 #endif 150 151 #endif /* STM32F4xx_HAL_FMPI2C_EX_H */ 152 153 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 154