STM32F479xx HAL User Manual
|
SMBUS HAL module driver. This file provides firmware functions to manage the following functionalities of the System Management Bus (SMBus) peripheral, based on SMBUS principals of operation : + Initialization and de-initialization functions + IO operation functions + Peripheral State, Mode and Error functions. More...
#include "stm32f4xx_hal.h"
Go to the source code of this file.
Defines | |
#define | SMBUS_TIMEOUT_FLAG 35U |
#define | SMBUS_TIMEOUT_BUSY_FLAG 25U |
#define | SMBUS_NO_OPTION_FRAME 0xFFFF0000U |
#define | SMBUS_SENDPEC_MODE I2C_CR1_PEC |
#define | SMBUS_GET_PEC(__HANDLE__) (((__HANDLE__)->Instance->SR2 & I2C_SR2_PEC) >> 8) |
#define | SMBUS_STATE_MSK ((uint32_t)((HAL_SMBUS_STATE_BUSY_TX | HAL_SMBUS_STATE_BUSY_RX) & (~(uint32_t)HAL_SMBUS_STATE_READY))) |
#define | SMBUS_STATE_NONE ((uint32_t)(HAL_SMBUS_MODE_NONE)) |
#define | SMBUS_STATE_MASTER_BUSY_TX ((uint32_t)((HAL_SMBUS_STATE_BUSY_TX & SMBUS_STATE_MSK) | HAL_SMBUS_MODE_MASTER)) |
#define | SMBUS_STATE_MASTER_BUSY_RX ((uint32_t)((HAL_SMBUS_STATE_BUSY_RX & SMBUS_STATE_MSK) | HAL_SMBUS_MODE_MASTER)) |
#define | SMBUS_STATE_SLAVE_BUSY_TX ((uint32_t)((HAL_SMBUS_STATE_BUSY_TX & SMBUS_STATE_MSK) | HAL_SMBUS_MODE_SLAVE)) |
#define | SMBUS_STATE_SLAVE_BUSY_RX ((uint32_t)((HAL_SMBUS_STATE_BUSY_RX & SMBUS_STATE_MSK) | HAL_SMBUS_MODE_SLAVE)) |
Functions | |
static HAL_StatusTypeDef | SMBUS_WaitOnFlagUntilTimeout (SMBUS_HandleTypeDef *hsmbus, uint32_t Flag, FlagStatus Status, uint32_t Timeout, uint32_t Tickstart) |
This function handles SMBUS Communication Timeout. | |
static void | SMBUS_ITError (SMBUS_HandleTypeDef *hsmbus) |
SMBUS interrupts error process. | |
static HAL_StatusTypeDef | SMBUS_MasterTransmit_TXE (SMBUS_HandleTypeDef *hsmbus) |
Handle TXE flag for Master. | |
static HAL_StatusTypeDef | SMBUS_MasterTransmit_BTF (SMBUS_HandleTypeDef *hsmbus) |
Handle BTF flag for Master transmitter. | |
static HAL_StatusTypeDef | SMBUS_MasterReceive_RXNE (SMBUS_HandleTypeDef *hsmbus) |
Handle RXNE flag for Master. | |
static HAL_StatusTypeDef | SMBUS_MasterReceive_BTF (SMBUS_HandleTypeDef *hsmbus) |
Handle BTF flag for Master receiver. | |
static HAL_StatusTypeDef | SMBUS_Master_SB (SMBUS_HandleTypeDef *hsmbus) |
Handle SB flag for Master. | |
static HAL_StatusTypeDef | SMBUS_Master_ADD10 (SMBUS_HandleTypeDef *hsmbus) |
Handle ADD10 flag for Master. | |
static HAL_StatusTypeDef | SMBUS_Master_ADDR (SMBUS_HandleTypeDef *hsmbus) |
Handle ADDR flag for Master. | |
static HAL_StatusTypeDef | SMBUS_SlaveTransmit_TXE (SMBUS_HandleTypeDef *hsmbus) |
Handle TXE flag for Slave. | |
static HAL_StatusTypeDef | SMBUS_SlaveTransmit_BTF (SMBUS_HandleTypeDef *hsmbus) |
Handle BTF flag for Slave transmitter. | |
static HAL_StatusTypeDef | SMBUS_SlaveReceive_RXNE (SMBUS_HandleTypeDef *hsmbus) |
Handle RXNE flag for Slave. | |
static HAL_StatusTypeDef | SMBUS_SlaveReceive_BTF (SMBUS_HandleTypeDef *hsmbus) |
Handle BTF flag for Slave receiver. | |
static HAL_StatusTypeDef | SMBUS_Slave_ADDR (SMBUS_HandleTypeDef *hsmbus) |
Handle ADD flag for Slave. | |
static HAL_StatusTypeDef | SMBUS_Slave_STOPF (SMBUS_HandleTypeDef *hsmbus) |
Handle STOPF flag for Slave. | |
static HAL_StatusTypeDef | SMBUS_Slave_AF (SMBUS_HandleTypeDef *hsmbus) |
HAL_StatusTypeDef | HAL_SMBUS_Init (SMBUS_HandleTypeDef *hsmbus) |
Initializes the SMBUS according to the specified parameters in the SMBUS_InitTypeDef and initialize the associated handle. | |
HAL_StatusTypeDef | HAL_SMBUS_DeInit (SMBUS_HandleTypeDef *hsmbus) |
DeInitializes the SMBUS peripheral. | |
__weak void | HAL_SMBUS_MspInit (SMBUS_HandleTypeDef *hsmbus) |
Initialize the SMBUS MSP. | |
__weak void | HAL_SMBUS_MspDeInit (SMBUS_HandleTypeDef *hsmbus) |
DeInitialize the SMBUS MSP. | |
HAL_StatusTypeDef | HAL_SMBUS_ConfigAnalogFilter (SMBUS_HandleTypeDef *hsmbus, uint32_t AnalogFilter) |
Configures SMBUS Analog noise filter. | |
HAL_StatusTypeDef | HAL_SMBUS_ConfigDigitalFilter (SMBUS_HandleTypeDef *hsmbus, uint32_t DigitalFilter) |
Configures SMBUS Digital noise filter. | |
HAL_StatusTypeDef | HAL_SMBUS_RegisterCallback (SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID, pSMBUS_CallbackTypeDef pCallback) |
Register a User SMBUS Callback To be used instead of the weak predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_UnRegisterCallback (SMBUS_HandleTypeDef *hsmbus, HAL_SMBUS_CallbackIDTypeDef CallbackID) |
Unregister an SMBUS Callback SMBUS callback is redirected to the weak predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_RegisterAddrCallback (SMBUS_HandleTypeDef *hsmbus, pSMBUS_AddrCallbackTypeDef pCallback) |
Register the Slave Address Match SMBUS Callback To be used instead of the weak HAL_SMBUS_AddrCallback() predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_UnRegisterAddrCallback (SMBUS_HandleTypeDef *hsmbus) |
UnRegister the Slave Address Match SMBUS Callback Info Ready SMBUS Callback is redirected to the weak HAL_SMBUS_AddrCallback() predefined callback. | |
HAL_StatusTypeDef | HAL_SMBUS_Master_Transmit_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Transmits in master mode an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_SMBUS_Master_Receive_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Receive in master/host SMBUS mode an amount of data in non blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_Master_Abort_IT (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress) |
Abort a master/host SMBUS process communication with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_Slave_Transmit_IT (SMBUS_HandleTypeDef *hsmbus, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Transmit in slave/device SMBUS mode an amount of data in non blocking mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_Slave_Receive_IT (SMBUS_HandleTypeDef *hsmbus, uint8_t *pData, uint16_t Size, uint32_t XferOptions) |
Enable the Address listen mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_EnableListen_IT (SMBUS_HandleTypeDef *hsmbus) |
Enable the Address listen mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_DisableListen_IT (SMBUS_HandleTypeDef *hsmbus) |
Disable the Address listen mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_EnableAlert_IT (SMBUS_HandleTypeDef *hsmbus) |
Enable the SMBUS alert mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_DisableAlert_IT (SMBUS_HandleTypeDef *hsmbus) |
Disable the SMBUS alert mode with Interrupt. | |
HAL_StatusTypeDef | HAL_SMBUS_IsDeviceReady (SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout) |
Check if target device is ready for communication. | |
void | HAL_SMBUS_EV_IRQHandler (SMBUS_HandleTypeDef *hsmbus) |
This function handles SMBUS event interrupt request. | |
void | HAL_SMBUS_ER_IRQHandler (SMBUS_HandleTypeDef *hsmbus) |
This function handles SMBUS error interrupt request. | |
__weak void | HAL_SMBUS_MasterTxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Master Tx Transfer completed callback. | |
__weak void | HAL_SMBUS_MasterRxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Master Rx Transfer completed callback. | |
__weak void | HAL_SMBUS_SlaveTxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Slave Tx Transfer completed callback. | |
__weak void | HAL_SMBUS_SlaveRxCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Slave Rx Transfer completed callback. | |
__weak void | HAL_SMBUS_AddrCallback (SMBUS_HandleTypeDef *hsmbus, uint8_t TransferDirection, uint16_t AddrMatchCode) |
Slave Address Match callback. | |
__weak void | HAL_SMBUS_ListenCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
Listen Complete callback. | |
__weak void | HAL_SMBUS_ErrorCallback (SMBUS_HandleTypeDef *hsmbus) |
SMBUS error callback. | |
__weak void | HAL_SMBUS_AbortCpltCallback (SMBUS_HandleTypeDef *hsmbus) |
SMBUS abort callback. | |
HAL_SMBUS_StateTypeDef | HAL_SMBUS_GetState (SMBUS_HandleTypeDef *hsmbus) |
Return the SMBUS handle state. | |
HAL_SMBUS_ModeTypeDef | HAL_SMBUS_GetMode (SMBUS_HandleTypeDef *hsmbus) |
Return the SMBUS Master, Slave or no mode. | |
uint32_t | HAL_SMBUS_GetError (SMBUS_HandleTypeDef *hsmbus) |
Return the SMBUS error code. |
SMBUS HAL module driver. This file provides firmware functions to manage the following functionalities of the System Management Bus (SMBus) peripheral, based on SMBUS principals of operation : + Initialization and de-initialization functions + IO operation functions + Peripheral State, Mode and Error functions.
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
Definition in file stm32f4xx_hal_smbus.c.