1 /**
2   ******************************************************************************
3   * @file    stm32wb0x_hal_smbus_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of SMBUS HAL Extended module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2024 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 STM32WB0x_HAL_SMBUS_EX_H
21 #define STM32WB0x_HAL_SMBUS_EX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32wb0x_hal_def.h"
29 
30 /** @addtogroup STM32WB0x_HAL_Driver
31   * @{
32   */
33 
34 /** @addtogroup SMBUSEx
35   * @{
36   */
37 
38 /* Exported types ------------------------------------------------------------*/
39 /* Exported constants --------------------------------------------------------*/
40 /** @defgroup SMBUSEx_Exported_Constants SMBUS Extended Exported Constants
41   * @{
42   */
43 
44 /** @defgroup SMBUSEx_FastModePlus SMBUS Extended Fast Mode Plus
45   * @{
46   */
47 #define SMBUS_FASTMODEPLUS_PA0            SYSCFG_I2C_FMP_CTRL_I2C1_PA0_FMP                        /*!< Enable Fast Mode Plus on PA0       */
48 #define SMBUS_FASTMODEPLUS_PA1            SYSCFG_I2C_FMP_CTRL_I2C1_PA1_FMP                        /*!< Enable Fast Mode Plus on PA1       */
49 #if defined(SYSCFG_I2C_FMP_CTRL_I2C2_PB6_FMP)
50 #define SMBUS_FASTMODEPLUS_PB6            SYSCFG_I2C_FMP_CTRL_I2C2_PB6_FMP                        /*!< Enable Fast Mode Plus on PB6       */
51 #define SMBUS_FASTMODEPLUS_PB7            SYSCFG_I2C_FMP_CTRL_I2C2_PB7_FMP
52 #else
53 #define SMBUS_FASTMODEPLUS_PB6            SYSCFG_I2C_FMP_CTRL_I2C1_PB6_FMP                        /*!< Enable Fast Mode Plus on PB6       */
54 #define SMBUS_FASTMODEPLUS_PB7            SYSCFG_I2C_FMP_CTRL_I2C1_PB7_FMP                        /*!< Enable Fast Mode Plus on PB7       */
55 #endif /* SYSCFG_I2C_FMP_CTRL_I2C2_PB6_FMP */
56 /**
57   * @}
58   */
59 
60 /**
61   * @}
62   */
63 
64 /* Exported macro ------------------------------------------------------------*/
65 /** @defgroup SMBUSEx_Exported_Macros SMBUS Extended Exported Macros
66   * @{
67   */
68 
69 /**
70   * @}
71   */
72 
73 /* Exported functions --------------------------------------------------------*/
74 /** @addtogroup SMBUSEx_Exported_Functions SMBUS Extended Exported Functions
75   * @{
76   */
77 
78 /** @addtogroup SMBUSEx_Exported_Functions_Group2 WakeUp Mode Functions
79   * @{
80   */
81 /* Peripheral Control functions  ************************************************/
82 /**
83   * @}
84   */
85 
86 /** @addtogroup SMBUSEx_Exported_Functions_Group3 Fast Mode Plus Functions
87   * @{
88   */
89 void HAL_SMBUSEx_EnableFastModePlus(uint32_t ConfigFastModePlus);
90 void HAL_SMBUSEx_DisableFastModePlus(uint32_t ConfigFastModePlus);
91 /**
92   * @}
93   */
94 
95 /**
96   * @}
97   */
98 
99 /* Private constants ---------------------------------------------------------*/
100 /** @defgroup SMBUSEx_Private_Constants SMBUS Extended Private Constants
101   * @{
102   */
103 
104 /**
105   * @}
106   */
107 
108 /* Private macros ------------------------------------------------------------*/
109 /** @defgroup SMBUSEx_Private_Macro SMBUS Extended Private Macros
110   * @{
111   */
112 #define IS_SMBUS_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & (SMBUS_FASTMODEPLUS_PB6))  == SMBUS_FASTMODEPLUS_PB6)   || \
113                                            (((__CONFIG__) & (SMBUS_FASTMODEPLUS_PB7))  == SMBUS_FASTMODEPLUS_PB7)   || \
114                                            (((__CONFIG__) & (SMBUS_FASTMODEPLUS_PA0))  == SMBUS_FASTMODEPLUS_PA0)   || \
115                                            (((__CONFIG__) & (SMBUS_FASTMODEPLUS_PA1))  == SMBUS_FASTMODEPLUS_PA1))
116 /**
117   * @}
118   */
119 
120 /* Private Functions ---------------------------------------------------------*/
121 /** @defgroup SMBUSEx_Private_Functions SMBUS Extended Private Functions
122   * @{
123   */
124 /* Private functions are defined in stm32wb0x_hal_smbus_ex.c file */
125 /**
126   * @}
127   */
128 
129 /**
130   * @}
131   */
132 
133 /**
134   * @}
135   */
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif /* STM32WB0x_HAL_SMBUS_EX_H */
142