Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:36

0001 /**
0002   ******************************************************************************
0003   * @file    stm32h7xx_hal_smbus_ex.h
0004   * @author  MCD Application Team
0005   * @brief   Header file of SMBUS HAL Extended module.
0006   ******************************************************************************
0007   * @attention
0008   *
0009   * Copyright (c) 2017 STMicroelectronics.
0010   * All rights reserved.
0011   *
0012   * This software is licensed under terms that can be found in the LICENSE file
0013   * in the root directory of this software component.
0014   * If no LICENSE file comes with this software, it is provided AS-IS.
0015   *
0016   ******************************************************************************
0017   */
0018 
0019 /* Define to prevent recursive inclusion -------------------------------------*/
0020 #ifndef STM32H7xx_HAL_SMBUS_EX_H
0021 #define STM32H7xx_HAL_SMBUS_EX_H
0022 
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026 
0027 /* Includes ------------------------------------------------------------------*/
0028 #include "stm32h7xx_hal_def.h"
0029 
0030 /** @addtogroup STM32H7xx_HAL_Driver
0031   * @{
0032   */
0033 
0034 /** @addtogroup SMBUSEx
0035   * @{
0036   */
0037 
0038 /* Exported types ------------------------------------------------------------*/
0039 /* Exported constants --------------------------------------------------------*/
0040 /** @defgroup SMBUSEx_Exported_Constants SMBUS Extended Exported Constants
0041   * @ingroup RTEMSBSPsARMSTM32H7
0042   * @{
0043   */
0044 
0045 /** @defgroup SMBUSEx_FastModePlus SMBUS Extended Fast Mode Plus
0046   * @ingroup RTEMSBSPsARMSTM32H7
0047   * @{
0048   */
0049 #define SMBUS_FMP_NOT_SUPPORTED           0xAAAA0000U                                     /*!< Fast Mode Plus not supported       */
0050 #define SMBUS_FASTMODEPLUS_PB6            SYSCFG_PMCR_I2C_PB6_FMP                        /*!< Enable Fast Mode Plus on PB6       */
0051 #define SMBUS_FASTMODEPLUS_PB7            SYSCFG_PMCR_I2C_PB7_FMP                        /*!< Enable Fast Mode Plus on PB7       */
0052 #define SMBUS_FASTMODEPLUS_PB8            SYSCFG_PMCR_I2C_PB8_FMP                        /*!< Enable Fast Mode Plus on PB8       */
0053 #define SMBUS_FASTMODEPLUS_PB9            SYSCFG_PMCR_I2C_PB9_FMP                        /*!< Enable Fast Mode Plus on PB9       */
0054 #define SMBUS_FASTMODEPLUS_I2C1           SYSCFG_PMCR_I2C1_FMP                           /*!< Enable Fast Mode Plus on I2C1 pins */
0055 #define SMBUS_FASTMODEPLUS_I2C2           SYSCFG_PMCR_I2C2_FMP                           /*!< Enable Fast Mode Plus on I2C2 pins */
0056 #define SMBUS_FASTMODEPLUS_I2C3           SYSCFG_PMCR_I2C3_FMP                           /*!< Enable Fast Mode Plus on I2C3 pins */
0057 #define SMBUS_FASTMODEPLUS_I2C4           SYSCFG_PMCR_I2C4_FMP                           /*!< Enable Fast Mode Plus on I2C4 pins */
0058 #if defined(SYSCFG_PMCR_I2C5_FMP)
0059 #define SMBUS_FASTMODEPLUS_I2C5           SYSCFG_PMCR_I2C5_FMP                           /*!< Enable Fast Mode Plus on I2C5 pins */
0060 #else
0061 #define SMBUS_FASTMODEPLUS_I2C5           (uint32_t)(0x00001000U | SMBUS_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C5 not supported  */
0062 #endif /* SYSCFG_PMCR_I2C5_FMP */
0063 /**
0064   * @}
0065   */
0066 
0067 /**
0068   * @}
0069   */
0070 
0071 /* Exported macro ------------------------------------------------------------*/
0072 /** @defgroup SMBUSEx_Exported_Macros SMBUS Extended Exported Macros
0073   * @ingroup RTEMSBSPsARMSTM32H7
0074   * @{
0075   */
0076 
0077 /**
0078   * @}
0079   */
0080 
0081 /* Exported functions --------------------------------------------------------*/
0082 /** @addtogroup SMBUSEx_Exported_Functions SMBUS Extended Exported Functions
0083   * @{
0084   */
0085 
0086 /** @addtogroup SMBUSEx_Exported_Functions_Group2 WakeUp Mode Functions
0087   * @{
0088   */
0089 /* Peripheral Control functions  ************************************************/
0090 HAL_StatusTypeDef HAL_SMBUSEx_EnableWakeUp(SMBUS_HandleTypeDef *hsmbus);
0091 HAL_StatusTypeDef HAL_SMBUSEx_DisableWakeUp(SMBUS_HandleTypeDef *hsmbus);
0092 /**
0093   * @}
0094   */
0095 
0096 /** @addtogroup SMBUSEx_Exported_Functions_Group3 Fast Mode Plus Functions
0097   * @{
0098   */
0099 void HAL_SMBUSEx_EnableFastModePlus(uint32_t ConfigFastModePlus);
0100 void HAL_SMBUSEx_DisableFastModePlus(uint32_t ConfigFastModePlus);
0101 /**
0102   * @}
0103   */
0104 
0105 /**
0106   * @}
0107   */
0108 
0109 /* Private constants ---------------------------------------------------------*/
0110 /** @defgroup SMBUSEx_Private_Constants SMBUS Extended Private Constants
0111   * @ingroup RTEMSBSPsARMSTM32H7
0112   * @{
0113   */
0114 
0115 /**
0116   * @}
0117   */
0118 
0119 /* Private macros ------------------------------------------------------------*/
0120 /** @defgroup SMBUSEx_Private_Macro SMBUS Extended Private Macros
0121   * @ingroup RTEMSBSPsARMSTM32H7
0122   * @{
0123   */
0124 #define IS_SMBUS_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & SMBUS_FASTMODEPLUS_PB6)  == SMBUS_FASTMODEPLUS_PB6)    || \
0125                                            (((__CONFIG__) & SMBUS_FASTMODEPLUS_PB7)  == SMBUS_FASTMODEPLUS_PB7)    || \
0126                                            (((__CONFIG__) & SMBUS_FASTMODEPLUS_PB8)  == SMBUS_FASTMODEPLUS_PB8)    || \
0127                                            (((__CONFIG__) & SMBUS_FASTMODEPLUS_PB9)  == SMBUS_FASTMODEPLUS_PB9)    || \
0128                                            (((__CONFIG__) & SMBUS_FASTMODEPLUS_I2C1) == SMBUS_FASTMODEPLUS_I2C1)   || \
0129                                            (((__CONFIG__) & SMBUS_FASTMODEPLUS_I2C2) == SMBUS_FASTMODEPLUS_I2C2)   || \
0130                                            (((__CONFIG__) & SMBUS_FASTMODEPLUS_I2C3) == SMBUS_FASTMODEPLUS_I2C3)   || \
0131                                            (((__CONFIG__) & SMBUS_FASTMODEPLUS_I2C4) == SMBUS_FASTMODEPLUS_I2C4))
0132 /**
0133   * @}
0134   */
0135 
0136 /* Private Functions ---------------------------------------------------------*/
0137 /** @defgroup SMBUSEx_Private_Functions SMBUS Extended Private Functions
0138   * @ingroup RTEMSBSPsARMSTM32H7
0139   * @{
0140   */
0141 /* Private functions are defined in stm32h7xx_hal_smbus_ex.c file */
0142 /**
0143   * @}
0144   */
0145 
0146 /**
0147   * @}
0148   */
0149 
0150 /**
0151   * @}
0152   */
0153 
0154 #ifdef __cplusplus
0155 }
0156 #endif
0157 
0158 #endif /* STM32H7xx_HAL_SMBUS_EX_H */