STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
SMBUS Exported Macros
Collaboration diagram for SMBUS Exported Macros:

Macros

#define __HAL_SMBUS_RESET_HANDLE_STATE(__HANDLE__)
 Reset SMBUS handle state.
 
#define __HAL_SMBUS_ENABLE_IT(__HANDLE__, __INTERRUPT__)
 Enable or disable the specified SMBUS interrupts.
 
#define __HAL_SMBUS_DISABLE_IT(__HANDLE__, __INTERRUPT__)
 
#define __HAL_SMBUS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
 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__)
 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__)
 Enable the SMBUS peripheral.
 
#define __HAL_SMBUS_DISABLE(__HANDLE__)
 Disable the SMBUS peripheral.
 
#define __HAL_SMBUS_GENERATE_NACK(__HANDLE__)
 Generate a Non-Acknowledge SMBUS peripheral in Slave mode.
 

Detailed Description

Macro Definition Documentation

◆ __HAL_SMBUS_RESET_HANDLE_STATE

#define __HAL_SMBUS_RESET_HANDLE_STATE ( __HANDLE__)

#include <stm32f4xx_hal_smbus.h>

Value:
((__HANDLE__)->State = HAL_SMBUS_STATE_RESET)
@ HAL_SMBUS_STATE_RESET

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 400 of file stm32f4xx_hal_smbus.h.

◆ __HAL_SMBUS_ENABLE_IT

#define __HAL_SMBUS_ENABLE_IT ( __HANDLE__,
__INTERRUPT__ )

#include <stm32f4xx_hal_smbus.h>

Value:
((__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 413 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().

◆ __HAL_SMBUS_DISABLE_IT

◆ __HAL_SMBUS_GET_IT_SOURCE

#define __HAL_SMBUS_GET_IT_SOURCE ( __HANDLE__,
__INTERRUPT__ )

#include <stm32f4xx_hal_smbus.h>

Value:
((((__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 426 of file stm32f4xx_hal_smbus.h.

◆ __HAL_SMBUS_GET_FLAG

#define __HAL_SMBUS_GET_FLAG ( __HANDLE__,
__FLAG__ )

#include <stm32f4xx_hal_smbus.h>

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)))
#define 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 457 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().

◆ __HAL_SMBUS_CLEAR_FLAG

#define __HAL_SMBUS_CLEAR_FLAG ( __HANDLE__,
__FLAG__ )

#include <stm32f4xx_hal_smbus.h>

Value:
((__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 474 of file stm32f4xx_hal_smbus.h.

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

◆ __HAL_SMBUS_CLEAR_ADDRFLAG

#define __HAL_SMBUS_CLEAR_ADDRFLAG ( __HANDLE__)

#include <stm32f4xx_hal_smbus.h>

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 481 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().

◆ __HAL_SMBUS_CLEAR_STOPFLAG

#define __HAL_SMBUS_CLEAR_STOPFLAG ( __HANDLE__)

#include <stm32f4xx_hal_smbus.h>

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 494 of file stm32f4xx_hal_smbus.h.

Referenced by SMBUS_Slave_STOPF().

◆ __HAL_SMBUS_ENABLE

#define __HAL_SMBUS_ENABLE ( __HANDLE__)

#include <stm32f4xx_hal_smbus.h>

Value:
((__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 507 of file stm32f4xx_hal_smbus.h.

Referenced by 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().

◆ __HAL_SMBUS_DISABLE

#define __HAL_SMBUS_DISABLE ( __HANDLE__)

#include <stm32f4xx_hal_smbus.h>

Value:
((__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 514 of file stm32f4xx_hal_smbus.h.

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

◆ __HAL_SMBUS_GENERATE_NACK

#define __HAL_SMBUS_GENERATE_NACK ( __HANDLE__)

#include <stm32f4xx_hal_smbus.h>

Value:
(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 520 of file stm32f4xx_hal_smbus.h.