STM32L443xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4xx_hal_smbus_ex.h 00004 * @author MCD Application Team 00005 * @brief Header file of SMBUS HAL Extended module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * Copyright (c) 2017 STMicroelectronics. 00010 * All rights reserved. 00011 * 00012 * This software is licensed under terms that can be found in the LICENSE file 00013 * in the root directory of this software component. 00014 * If no LICENSE file comes with this software, it is provided AS-IS. 00015 * 00016 ****************************************************************************** 00017 */ 00018 00019 /* Define to prevent recursive inclusion -------------------------------------*/ 00020 #ifndef STM32L4xx_HAL_SMBUS_EX_H 00021 #define STM32L4xx_HAL_SMBUS_EX_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm32l4xx_hal_def.h" 00029 00030 /** @addtogroup STM32L4xx_HAL_Driver 00031 * @{ 00032 */ 00033 00034 /** @addtogroup SMBUSEx 00035 * @{ 00036 */ 00037 00038 /* Exported types ------------------------------------------------------------*/ 00039 /* Exported constants --------------------------------------------------------*/ 00040 /** @defgroup SMBUSEx_Exported_Constants SMBUS Extended Exported Constants 00041 * @{ 00042 */ 00043 00044 /** @defgroup SMBUSEx_FastModePlus SMBUS Extended Fast Mode Plus 00045 * @{ 00046 */ 00047 #define SMBUS_FMP_NOT_SUPPORTED 0xAAAA0000U /*!< Fast Mode Plus not supported */ 00048 #define SMBUS_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */ 00049 #define SMBUS_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */ 00050 #if defined(SYSCFG_CFGR1_I2C_PB8_FMP) 00051 #define SMBUS_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */ 00052 #define SMBUS_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */ 00053 #else 00054 #define SMBUS_FASTMODEPLUS_PB8 (uint32_t)(0x00000010U | SMBUS_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus PB8 not supported */ 00055 #define SMBUS_FASTMODEPLUS_PB9 (uint32_t)(0x00000012U | SMBUS_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus PB9 not supported */ 00056 #endif /* SYSCFG_CFGR1_I2C_PB8_FMP */ 00057 #define SMBUS_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */ 00058 #if defined(SYSCFG_CFGR1_I2C2_FMP) 00059 #define SMBUS_FASTMODEPLUS_I2C2 SYSCFG_CFGR1_I2C2_FMP /*!< Enable Fast Mode Plus on I2C2 pins */ 00060 #else 00061 #define SMBUS_FASTMODEPLUS_I2C2 (uint32_t)(0x00000200U | SMBUS_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C2 not supported */ 00062 #endif /* SYSCFG_CFGR1_I2C2_FMP */ 00063 #define SMBUS_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */ 00064 #if defined(SYSCFG_CFGR1_I2C4_FMP) 00065 #define SMBUS_FASTMODEPLUS_I2C4 SYSCFG_CFGR1_I2C4_FMP /*!< Enable Fast Mode Plus on I2C4 pins */ 00066 #else 00067 #define SMBUS_FASTMODEPLUS_I2C4 (uint32_t)(0x00000800U | SMBUS_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C4 not supported */ 00068 #endif /* SYSCFG_CFGR1_I2C4_FMP */ 00069 /** 00070 * @} 00071 */ 00072 00073 /** 00074 * @} 00075 */ 00076 00077 /* Exported macro ------------------------------------------------------------*/ 00078 /** @defgroup SMBUSEx_Exported_Macros SMBUS Extended Exported Macros 00079 * @{ 00080 */ 00081 00082 /** 00083 * @} 00084 */ 00085 00086 /* Exported functions --------------------------------------------------------*/ 00087 /** @addtogroup SMBUSEx_Exported_Functions SMBUS Extended Exported Functions 00088 * @{ 00089 */ 00090 00091 /** @addtogroup SMBUSEx_Exported_Functions_Group2 WakeUp Mode Functions 00092 * @{ 00093 */ 00094 /* Peripheral Control functions ************************************************/ 00095 HAL_StatusTypeDef HAL_SMBUSEx_EnableWakeUp(SMBUS_HandleTypeDef *hsmbus); 00096 HAL_StatusTypeDef HAL_SMBUSEx_DisableWakeUp(SMBUS_HandleTypeDef *hsmbus); 00097 /** 00098 * @} 00099 */ 00100 00101 /** @addtogroup SMBUSEx_Exported_Functions_Group3 Fast Mode Plus Functions 00102 * @{ 00103 */ 00104 void HAL_SMBUSEx_EnableFastModePlus(uint32_t ConfigFastModePlus); 00105 void HAL_SMBUSEx_DisableFastModePlus(uint32_t ConfigFastModePlus); 00106 /** 00107 * @} 00108 */ 00109 00110 /** 00111 * @} 00112 */ 00113 00114 /* Private constants ---------------------------------------------------------*/ 00115 /** @defgroup SMBUSEx_Private_Constants SMBUS Extended Private Constants 00116 * @{ 00117 */ 00118 00119 /** 00120 * @} 00121 */ 00122 00123 /* Private macros ------------------------------------------------------------*/ 00124 /** @defgroup SMBUSEx_Private_Macro SMBUS Extended Private Macros 00125 * @{ 00126 */ 00127 #define IS_SMBUS_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & SMBUS_FMP_NOT_SUPPORTED) != SMBUS_FMP_NOT_SUPPORTED) && \ 00128 ((((__CONFIG__) & (SMBUS_FASTMODEPLUS_PB6)) == SMBUS_FASTMODEPLUS_PB6) || \ 00129 (((__CONFIG__) & (SMBUS_FASTMODEPLUS_PB7)) == SMBUS_FASTMODEPLUS_PB7) || \ 00130 (((__CONFIG__) & (SMBUS_FASTMODEPLUS_PB8)) == SMBUS_FASTMODEPLUS_PB8) || \ 00131 (((__CONFIG__) & (SMBUS_FASTMODEPLUS_PB9)) == SMBUS_FASTMODEPLUS_PB9) || \ 00132 (((__CONFIG__) & (SMBUS_FASTMODEPLUS_I2C1)) == SMBUS_FASTMODEPLUS_I2C1) || \ 00133 (((__CONFIG__) & (SMBUS_FASTMODEPLUS_I2C2)) == SMBUS_FASTMODEPLUS_I2C2) || \ 00134 (((__CONFIG__) & (SMBUS_FASTMODEPLUS_I2C3)) == SMBUS_FASTMODEPLUS_I2C3) || \ 00135 (((__CONFIG__) & (SMBUS_FASTMODEPLUS_I2C4)) == SMBUS_FASTMODEPLUS_I2C4))) 00136 /** 00137 * @} 00138 */ 00139 00140 /* Private Functions ---------------------------------------------------------*/ 00141 /** @defgroup SMBUSEx_Private_Functions SMBUS Extended Private Functions 00142 * @{ 00143 */ 00144 /* Private functions are defined in stm32l4xx_hal_smbus_ex.c file */ 00145 /** 00146 * @} 00147 */ 00148 00149 /** 00150 * @} 00151 */ 00152 00153 /** 00154 * @} 00155 */ 00156 00157 #ifdef __cplusplus 00158 } 00159 #endif 00160 00161 #endif /* STM32L4xx_HAL_SMBUS_EX_H */