1 /**
2   ******************************************************************************
3   * @file    stm32f4xx_hal_i2c_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of I2C HAL Extension 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_I2C_EX_H
21 #define __STM32F4xx_HAL_I2C_EX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #if  defined(I2C_FLTR_ANOFF)&&defined(I2C_FLTR_DNF)
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f4xx_hal_def.h"
30 
31 /** @addtogroup STM32F4xx_HAL_Driver
32   * @{
33   */
34 
35 /** @addtogroup I2CEx
36   * @{
37   */
38 
39 /* Exported types ------------------------------------------------------------*/
40 /* Exported constants --------------------------------------------------------*/
41 /** @defgroup I2CEx_Exported_Constants I2C Exported Constants
42   * @{
43   */
44 
45 /** @defgroup I2CEx_Analog_Filter I2C Analog Filter
46   * @{
47   */
48 #define I2C_ANALOGFILTER_ENABLE        0x00000000U
49 #define I2C_ANALOGFILTER_DISABLE       I2C_FLTR_ANOFF
50 /**
51   * @}
52   */
53 
54 /**
55   * @}
56   */
57 
58 /* Exported macro ------------------------------------------------------------*/
59 /* Exported functions --------------------------------------------------------*/
60 /** @addtogroup I2CEx_Exported_Functions
61   * @{
62   */
63 
64 /** @addtogroup I2CEx_Exported_Functions_Group1
65   * @{
66   */
67 /* Peripheral Control functions  ************************************************/
68 HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter);
69 HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter);
70 /**
71   * @}
72   */
73 
74 /**
75   * @}
76   */
77 /* Private types -------------------------------------------------------------*/
78 /* Private variables ---------------------------------------------------------*/
79 /* Private constants ---------------------------------------------------------*/
80 /** @defgroup I2CEx_Private_Constants I2C Private Constants
81   * @{
82   */
83 
84 /**
85   * @}
86   */
87 
88 /* Private macros ------------------------------------------------------------*/
89 /** @defgroup I2CEx_Private_Macros I2C Private Macros
90   * @{
91   */
92 #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \
93                                       ((FILTER) == I2C_ANALOGFILTER_DISABLE))
94 #define IS_I2C_DIGITAL_FILTER(FILTER)   ((FILTER) <= 0x0000000FU)
95 /**
96   * @}
97   */
98 
99 /**
100   * @}
101   */
102 
103 /**
104   * @}
105   */
106 
107 #endif
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif /* __STM32F4xx_HAL_I2C_EX_H */
114 
115 
116