xref: /btstack/port/stm32-f4discovery-usb/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_fmpi2c_ex.h (revision a8f7f3fcbcd51f8d2e92aca076b6a9f812db358c)
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>&copy; 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 
43 /** @defgroup FMPI2CEx_Exported_Constants FMPI2C Extended Exported Constants
44   * @{
45   */
46 
47 /** @defgroup FMPI2CEx_Analog_Filter FMPI2C Extended Analog Filter
48   * @{
49   */
50 #define FMPI2C_ANALOGFILTER_ENABLE         0x00000000U
51 #define FMPI2C_ANALOGFILTER_DISABLE        FMPI2C_CR1_ANFOFF
52 /**
53   * @}
54   */
55 
56 /** @defgroup FMPI2CEx_FastModePlus FMPI2C Extended Fast Mode Plus
57   * @{
58   */
59 #define FMPI2C_FASTMODEPLUS_SCL            SYSCFG_CFGR_FMPI2C1_SCL  /*!< Enable Fast Mode Plus on FMPI2C1 SCL pins       */
60 #define FMPI2C_FASTMODEPLUS_SDA            SYSCFG_CFGR_FMPI2C1_SDA  /*!< Enable Fast Mode Plus on FMPI2C1 SDA pins       */
61 /**
62   * @}
63   */
64 
65 /**
66   * @}
67   */
68 
69 /* Exported macro ------------------------------------------------------------*/
70 /* Exported functions --------------------------------------------------------*/
71 
72 /** @addtogroup FMPI2CEx_Exported_Functions FMPI2C Extended Exported Functions
73   * @{
74   */
75 
76 /** @addtogroup FMPI2CEx_Exported_Functions_Group1 Extended features functions
77   * @brief    Extended features functions
78   * @{
79   */
80 
81 /* Peripheral Control functions  ************************************************/
82 HAL_StatusTypeDef HAL_FMPI2CEx_ConfigAnalogFilter(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t AnalogFilter);
83 HAL_StatusTypeDef HAL_FMPI2CEx_ConfigDigitalFilter(FMPI2C_HandleTypeDef *hfmpi2c, uint32_t DigitalFilter);
84 void HAL_FMPI2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus);
85 void HAL_FMPI2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus);
86 
87 /* Private constants ---------------------------------------------------------*/
88 /** @defgroup FMPI2CEx_Private_Constants FMPI2C Extended Private Constants
89   * @{
90   */
91 
92 /**
93   * @}
94   */
95 
96 /* Private macros ------------------------------------------------------------*/
97 /** @defgroup FMPI2CEx_Private_Macro FMPI2C Extended Private Macros
98   * @{
99   */
100 #define IS_FMPI2C_ANALOG_FILTER(FILTER)    (((FILTER) == FMPI2C_ANALOGFILTER_ENABLE) || \
101                                           ((FILTER) == FMPI2C_ANALOGFILTER_DISABLE))
102 
103 #define IS_FMPI2C_DIGITAL_FILTER(FILTER)   ((FILTER) <= 0x0000000FU)
104 
105 #define IS_FMPI2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (FMPI2C_FASTMODEPLUS_SCL)) == FMPI2C_FASTMODEPLUS_SCL) || \
106                                             (((__CONFIG__) & (FMPI2C_FASTMODEPLUS_SDA)) == FMPI2C_FASTMODEPLUS_SDA))
107 
108 
109 
110 /**
111   * @}
112   */
113 
114 /* Private Functions ---------------------------------------------------------*/
115 /** @defgroup FMPI2CEx_Private_Functions FMPI2C Extended Private Functions
116   * @{
117   */
118 /* Private functions are defined in stm32f4xx_hal_fmpfmpi2c_ex.c file */
119 /**
120   * @}
121   */
122 
123 /**
124   * @}
125   */
126 
127 /**
128   * @}
129   */
130 
131 /**
132   * @}
133   */
134 
135 /**
136   * @}
137   */
138 
139 #endif /* FMPI2C_CR1_PE */
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif /* STM32F4xx_HAL_FMPI2C_EX_H */
145 
146 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
147