STM32F479xx HAL User Manual
Defines
SMBUS Exported Macros
SMBUS

Defines

#define __HAL_SMBUS_RESET_HANDLE_STATE(__HANDLE__)
 Reset SMBUS handle state.
#define __HAL_SMBUS_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR2 |= (__INTERRUPT__))
 Enable or disable the specified SMBUS interrupts.
#define __HAL_SMBUS_DISABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR2 &= (~(__INTERRUPT__)))
#define __HAL_SMBUS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)   ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
 Checks if the specified SMBUS interrupt source is enabled or disabled.
#define __HAL_SMBUS_GET_FLAG(__HANDLE__, __FLAG__)
 Checks whether the specified SMBUS flag is set or not.
#define __HAL_SMBUS_CLEAR_FLAG(__HANDLE__, __FLAG__)   ((__HANDLE__)->Instance->SR1 = ~((__FLAG__) & SMBUS_FLAG_MASK))
 Clears the SMBUS pending flags which are cleared by writing 0 in a specific bit.
#define __HAL_SMBUS_CLEAR_ADDRFLAG(__HANDLE__)
 Clears the SMBUS ADDR pending flag.
#define __HAL_SMBUS_CLEAR_STOPFLAG(__HANDLE__)
 Clears the SMBUS STOPF pending flag.
#define __HAL_SMBUS_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 |= I2C_CR1_PE)
 Enable the SMBUS peripheral.
#define __HAL_SMBUS_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 &= ~I2C_CR1_PE)
 Disable the SMBUS peripheral.
#define __HAL_SMBUS_GENERATE_NACK(__HANDLE__)   (CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_ACK))
 Generate a Non-Acknowledge SMBUS peripheral in Slave mode.

Define Documentation

#define __HAL_SMBUS_CLEAR_ADDRFLAG (   __HANDLE__)
Value:
do{                                           \
    __IO uint32_t tmpreg = 0x00U;               \
    tmpreg = (__HANDLE__)->Instance->SR1;       \
    tmpreg = (__HANDLE__)->Instance->SR2;       \
    UNUSED(tmpreg);                             \
  } while(0)

Clears the SMBUS ADDR pending flag.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUS where x: 1, 2, or 3 to select the SMBUS peripheral.
Return values:
None

Definition at line 482 of file stm32f4xx_hal_smbus.h.

Referenced by HAL_SMBUS_IsDeviceReady(), HAL_SMBUS_Slave_Receive_IT(), HAL_SMBUS_Slave_Transmit_IT(), and SMBUS_Master_ADDR().

#define __HAL_SMBUS_CLEAR_FLAG (   __HANDLE__,
  __FLAG__ 
)    ((__HANDLE__)->Instance->SR1 = ~((__FLAG__) & SMBUS_FLAG_MASK))

Clears the SMBUS pending flags which are cleared by writing 0 in a specific bit.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUS where x: 1, 2, or 3 to select the SMBUS peripheral.
__FLAG__specifies the flag to clear. This parameter can be any combination of the following values:
  • SMBUS_FLAG_SMBALERT: SMBus Alert flag
  • SMBUS_FLAG_TIMEOUT: Timeout or Tlow error flag
  • SMBUS_FLAG_PECERR: PEC error in reception flag
  • SMBUS_FLAG_OVR: Overrun/Underrun flag (Slave mode)
  • SMBUS_FLAG_AF: Acknowledge failure flag
  • SMBUS_FLAG_ARLO: Arbitration lost flag (Master mode)
  • SMBUS_FLAG_BERR: Bus error flag
Return values:
None

Definition at line 475 of file stm32f4xx_hal_smbus.h.

Referenced by HAL_SMBUS_EnableAlert_IT(), HAL_SMBUS_ER_IRQHandler(), HAL_SMBUS_IsDeviceReady(), and SMBUS_Slave_AF().

#define __HAL_SMBUS_CLEAR_STOPFLAG (   __HANDLE__)
Value:
do{                                           \
    __IO uint32_t tmpreg = 0x00U;               \
    tmpreg = (__HANDLE__)->Instance->SR1;       \
    (__HANDLE__)->Instance->CR1 |= I2C_CR1_PE;  \
    UNUSED(tmpreg);                             \
  } while(0)

Clears the SMBUS STOPF pending flag.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUS where x: 1, 2, or 3 to select the SMBUS peripheral.
Return values:
None

Definition at line 495 of file stm32f4xx_hal_smbus.h.

Referenced by SMBUS_Slave_STOPF().

#define __HAL_SMBUS_DISABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 &= ~I2C_CR1_PE)

Disable the SMBUS peripheral.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUSx where x: 1 or 2 to select the SMBUS peripheral.
Return values:
None

Definition at line 515 of file stm32f4xx_hal_smbus.h.

Referenced by HAL_SMBUS_ConfigAnalogFilter(), HAL_SMBUS_ConfigDigitalFilter(), HAL_SMBUS_DeInit(), HAL_SMBUS_Init(), and SMBUS_ITError().

#define __HAL_SMBUS_DISABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)    ((__HANDLE__)->Instance->CR2 &= (~(__INTERRUPT__)))
#define __HAL_SMBUS_ENABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 |= I2C_CR1_PE)

Enable the SMBUS peripheral.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUSx where x: 1 or 2 to select the SMBUS peripheral.
Return values:
None

Definition at line 508 of file stm32f4xx_hal_smbus.h.

Referenced by HAL_SMBUS_ConfigAnalogFilter(), HAL_SMBUS_ConfigDigitalFilter(), HAL_SMBUS_EnableListen_IT(), HAL_SMBUS_Init(), HAL_SMBUS_IsDeviceReady(), HAL_SMBUS_Master_Receive_IT(), HAL_SMBUS_Master_Transmit_IT(), HAL_SMBUS_Slave_Receive_IT(), and HAL_SMBUS_Slave_Transmit_IT().

#define __HAL_SMBUS_ENABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)    ((__HANDLE__)->Instance->CR2 |= (__INTERRUPT__))

Enable or disable the specified SMBUS interrupts.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUS where x: 1, 2, or 3 to select the SMBUS peripheral.
__INTERRUPT__specifies the interrupt source to enable or disable. This parameter can be one of the following values:
  • SMBUS_IT_BUF: Buffer interrupt enable
  • SMBUS_IT_EVT: Event interrupt enable
  • SMBUS_IT_ERR: Error interrupt enable
Return values:
None

Definition at line 414 of file stm32f4xx_hal_smbus.h.

Referenced by HAL_SMBUS_EnableAlert_IT(), HAL_SMBUS_EnableListen_IT(), HAL_SMBUS_Master_Receive_IT(), HAL_SMBUS_Master_Transmit_IT(), HAL_SMBUS_Slave_Receive_IT(), and HAL_SMBUS_Slave_Transmit_IT().

#define __HAL_SMBUS_GENERATE_NACK (   __HANDLE__)    (CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_ACK))

Generate a Non-Acknowledge SMBUS peripheral in Slave mode.

Parameters:
__HANDLE__specifies the SMBUS Handle.
Return values:
None

Definition at line 521 of file stm32f4xx_hal_smbus.h.

#define __HAL_SMBUS_GET_FLAG (   __HANDLE__,
  __FLAG__ 
)
Value:
((((uint8_t)((__FLAG__) >> 16U)) == 0x01U)?((((__HANDLE__)->Instance->SR1) & ((__FLAG__) & SMBUS_FLAG_MASK)) == ((__FLAG__) & SMBUS_FLAG_MASK)): \
                                                 ((((__HANDLE__)->Instance->SR2) & ((__FLAG__) & SMBUS_FLAG_MASK)) == ((__FLAG__) & SMBUS_FLAG_MASK)))

Checks whether the specified SMBUS flag is set or not.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUS where x: 1, 2, or 3 to select the SMBUS peripheral.
__FLAG__specifies the flag to check. This parameter can be one of the following values:
  • SMBUS_FLAG_SMBALERT: SMBus Alert flag
  • SMBUS_FLAG_TIMEOUT: Timeout or Tlow error flag
  • SMBUS_FLAG_PECERR: PEC error in reception flag
  • SMBUS_FLAG_OVR: Overrun/Underrun flag
  • SMBUS_FLAG_AF: Acknowledge failure flag
  • SMBUS_FLAG_ARLO: Arbitration lost flag
  • SMBUS_FLAG_BERR: Bus error flag
  • SMBUS_FLAG_TXE: Data register empty flag
  • SMBUS_FLAG_RXNE: Data register not empty flag
  • SMBUS_FLAG_STOPF: Stop detection flag
  • SMBUS_FLAG_ADD10: 10-bit header sent flag
  • SMBUS_FLAG_BTF: Byte transfer finished flag
  • SMBUS_FLAG_ADDR: Address sent flag Address matched flag
  • SMBUS_FLAG_SB: Start bit flag
  • SMBUS_FLAG_DUALF: Dual flag
  • SMBUS_FLAG_SMBHOST: SMBus host header
  • SMBUS_FLAG_SMBDEFAULT: SMBus default header
  • SMBUS_FLAG_GENCALL: General call header flag
  • SMBUS_FLAG_TRA: Transmitter/Receiver flag
  • SMBUS_FLAG_BUSY: Bus busy flag
  • SMBUS_FLAG_MSL: Master/Slave flag
Return values:
Thenew state of __FLAG__ (TRUE or FALSE).

Definition at line 458 of file stm32f4xx_hal_smbus.h.

Referenced by HAL_SMBUS_IsDeviceReady(), HAL_SMBUS_Master_Receive_IT(), HAL_SMBUS_Master_Transmit_IT(), SMBUS_ITError(), SMBUS_Slave_ADDR(), SMBUS_Slave_STOPF(), and SMBUS_WaitOnFlagUntilTimeout().

#define __HAL_SMBUS_GET_IT_SOURCE (   __HANDLE__,
  __INTERRUPT__ 
)    ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)

Checks if the specified SMBUS interrupt source is enabled or disabled.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUS where x: 1, 2, or 3 to select the SMBUS peripheral.
__INTERRUPT__specifies the SMBUS interrupt source to check. This parameter can be one of the following values:
  • SMBUS_IT_BUF: Buffer interrupt enable
  • SMBUS_IT_EVT: Event interrupt enable
  • SMBUS_IT_ERR: Error interrupt enable
Return values:
Thenew state of __INTERRUPT__ (TRUE or FALSE).

Definition at line 427 of file stm32f4xx_hal_smbus.h.

#define __HAL_SMBUS_RESET_HANDLE_STATE (   __HANDLE__)
Value:
do{                                                  \
                                                                (__HANDLE__)->State = HAL_SMBUS_STATE_RESET;     \
                                                                (__HANDLE__)->MspInitCallback = NULL;            \
                                                                (__HANDLE__)->MspDeInitCallback = NULL;          \
                                                              } while(0)

Reset SMBUS handle state.

Parameters:
__HANDLE__specifies the SMBUS Handle. This parameter can be SMBUS where x: 1, 2, or 3 to select the SMBUS peripheral.
Return values:
None

Definition at line 395 of file stm32f4xx_hal_smbus.h.