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