STM32G474xx HAL用户手册
宏定义 | 函数
stm32g4xx_hal_smbus.c文件参考

SMBUS HAL模块驱动程序。本文件提供固件函数来管理系统管理总线(SMBus)外设的以下功能,基于I2C工作原理:+初始化和去初始化函数+IO操作函数+外设状态和错误函数。 更多...

#include "stm32g4xx_hal.h"

转到此文件的源代码。

宏定义

#define TIMING_CLEAR_MASK   (0xF0FFFFFFUL)
#define HAL_TIMEOUT_ADDR   (10000U)
#define HAL_TIMEOUT_BUSY   (25U)
#define HAL_TIMEOUT_DIR   (25U)
#define HAL_TIMEOUT_RXNE   (25U)
#define HAL_TIMEOUT_STOPF   (25U)
#define HAL_TIMEOUT_TC   (25U)
#define HAL_TIMEOUT_TCR   (25U)
#define HAL_TIMEOUT_TXIS   (25U)
#define MAX_NBYTE_SIZE   255U

函数

static HAL_StatusTypeDef SMBUS_WaitOnFlagUntilTimeout (SMBUS_HandleTypeDef *hsmbus, uint32_t Flag, FlagStatus Status, uint32_t Timeout)
 处理SMBUS通信超时。
static HAL_StatusTypeDef SMBUS_Master_ISR (SMBUS_HandleTypeDef *hsmbus, uint32_t StatusFlags)
 中断子程序,处理主模式下中断标志。
static HAL_StatusTypeDef SMBUS_Slave_ISR (SMBUS_HandleTypeDef *hsmbus, uint32_t StatusFlags)
 中断子程序,处理从模式下中断标志。
static void SMBUS_ITErrorHandler (SMBUS_HandleTypeDef *hsmbus)
 SMBUS中断错误处理程序。
static void SMBUS_Enable_IRQ (SMBUS_HandleTypeDef *hsmbus, uint32_t InterruptRequest)
 管理中断的使能。
static void SMBUS_Disable_IRQ (SMBUS_HandleTypeDef *hsmbus, uint32_t InterruptRequest)
 管理中断的禁用。
static void SMBUS_Flush_TXDR (SMBUS_HandleTypeDef *hsmbus)
 SMBUS发送数据寄存器刷新过程。
static void SMBUS_TransferConfig (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t Size, uint32_t Mode, uint32_t Request)
 在开始传输或传输过程中处理SMBUSx通信(当设置了TC或TCR标志时)。
static void SMBUS_ConvertOtherXferOptions (SMBUS_HandleTypeDef *hsmbus)
 将SMBUSx OTHER_xxx XferOptions转换为功能XferOptions。
HAL_StatusTypeDef HAL_SMBUS_Init (SMBUS_HandleTypeDef *hsmbus)
 根据SMBUS_InitTypeDef中指定的参数初始化SMBUS,并初始化关联的句柄。
HAL_StatusTypeDef HAL_SMBUS_DeInit (SMBUS_HandleTypeDef *hsmbus)
 去初始化SMBUS外设。
__weak void HAL_SMBUS_MspInit (SMBUS_HandleTypeDef *hsmbus)
 初始化SMBUS MSP。
__weak void HAL_SMBUS_MspDeInit (SMBUS_HandleTypeDef *hsmbus)
 去初始化SMBUS MSP。
HAL_StatusTypeDef HAL_SMBUS_ConfigAnalogFilter (SMBUS_HandleTypeDef *hsmbus, uint32_t AnalogFilter)
 配置模拟噪声滤波器。
HAL_StatusTypeDef HAL_SMBUS_ConfigDigitalFilter (SMBUS_HandleTypeDef *hsmbus, uint32_t DigitalFilter)
 配置数字噪声滤波器。
HAL_StatusTypeDef HAL_SMBUS_RegisterCallback (SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID, pSMBUS_CallbackTypeDef pCallback)
 注册用户SMBUS回调函数,用于替代弱预定义的回调函数。
HAL_StatusTypeDef HAL_SMBUS_UnRegisterCallback (SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID)
 注销SMBUS回调函数 SMBUS回调重定向到弱预定义的回调函数。
HAL_StatusTypeDef HAL_SMBUS_RegisterAddrCallback (SMBUS_HandleTypeDef *hsmbus, pSMBUS_AddrCallbackTypeDef pCallback)
 注册从机地址匹配SMBUS回调函数,用于替代弱HAL_SMBUS_AddrCallback()预定义的回调函数。
HAL_StatusTypeDef HAL_SMBUS_UnRegisterAddrCallback (SMBUS_HandleTypeDef *hsmbus)
 注销从机地址匹配SMBUS回调函数 信息就绪SMBUS回调重定向到弱HAL_SMBUS_AddrCallback()预定义的回调函数。
HAL_StatusTypeDef HAL_SMBUS_Master_Transmit_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
 在主/主机SMBUS模式下以中断非阻塞模式传输数据。
HAL_StatusTypeDef HAL_SMBUS_Master_Receive_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
 在主/主机SMBUS模式下以中断非阻塞模式接收数据。
HAL_StatusTypeDef HAL_SMBUS_Master_Abort_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress)
 中止主/主机SMBUS进程通信(使用中断)。
HAL_StatusTypeDef HAL_SMBUS_Slave_Transmit_IT (SMBUS_HandleTypeDef *hsmbus, uint8_t *pData, uint16_t Size, uint32_t XferOptions)
 在从/