RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Macros

Macros

#define __HAL_SMBUS_RESET_HANDLE_STATE(__HANDLE__)   ((__HANDLE__)->State = HAL_SMBUS_STATE_RESET)
 Reset SMBUS handle state.
 
#define __HAL_SMBUS_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR1 |= (__INTERRUPT__))
 Enable the specified SMBUS interrupts.
 
#define __HAL_SMBUS_DISABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__)))
 Disable the specified SMBUS interrupts.
 
#define __HAL_SMBUS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)    ((((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
 Check whether the specified SMBUS interrupt source is enabled or not.
 
#define SMBUS_FLAG_MASK   (0x0001FFFFU)
 Check whether the specified SMBUS flag is set or not.
 
#define __HAL_SMBUS_GET_FLAG(__HANDLE__, __FLAG__)
 
#define __HAL_SMBUS_CLEAR_FLAG(__HANDLE__, __FLAG__)
 Clear the SMBUS pending flags which are cleared by writing 1 in a specific bit.
 
#define __HAL_SMBUS_ENABLE(__HANDLE__)   (SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE))
 Enable the specified SMBUS peripheral.
 
#define __HAL_SMBUS_DISABLE(__HANDLE__)   (CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE))
 Disable the specified SMBUS peripheral.
 
#define __HAL_SMBUS_GENERATE_NACK(__HANDLE__)   (SET_BIT((__HANDLE__)->Instance->CR2, I2C_CR2_NACK))
 Generate a Non-Acknowledge SMBUS peripheral in Slave mode.
 

Detailed Description

Macro Definition Documentation

◆ __HAL_SMBUS_CLEAR_FLAG

#define __HAL_SMBUS_CLEAR_FLAG (   __HANDLE__,
  __FLAG__ 
)
Value:
(((__FLAG__) == SMBUS_FLAG_TXE) ? \
((__HANDLE__)->Instance->ISR |= (__FLAG__)) : \
((__HANDLE__)->Instance->ICR = (__FLAG__)))

Clear the SMBUS pending flags which are cleared by writing 1 in a specific bit.

Parameters
__HANDLE__specifies the SMBUS Handle.
__FLAG__specifies the flag to clear. This parameter can be any combination of the following values:
  • SMBUS_FLAG_TXE Transmit data register empty
  • SMBUS_FLAG_ADDR Address matched (slave mode)
  • SMBUS_FLAG_AF NACK received flag
  • SMBUS_FLAG_STOPF STOP detection flag
  • SMBUS_FLAG_BERR Bus error
  • SMBUS_FLAG_ARLO Arbitration lost
  • SMBUS_FLAG_OVR Overrun/Underrun
  • SMBUS_FLAG_PECERR PEC error in reception
  • SMBUS_FLAG_TIMEOUT Timeout or Tlow detection flag
  • SMBUS_FLAG_ALERT SMBus alert
Return values
None

◆ __HAL_SMBUS_DISABLE

#define __HAL_SMBUS_DISABLE (   __HANDLE__)    (CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE))

Disable the specified SMBUS peripheral.

Parameters
__HANDLE__specifies the SMBUS Handle.
Return values
None

◆ __HAL_SMBUS_DISABLE_IT

#define __HAL_SMBUS_DISABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)    ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__)))

Disable the specified SMBUS interrupts.

Parameters
__HANDLE__specifies the SMBUS Handle.
__INTERRUPT__specifies the interrupt source to disable. This parameter can be one of the following values:
  • SMBUS_IT_ERRI Errors interrupt enable
  • SMBUS_IT_TCI Transfer complete interrupt enable
  • SMBUS_IT_STOPI STOP detection interrupt enable
  • SMBUS_IT_NACKI NACK received interrupt enable
  • SMBUS_IT_ADDRI Address match interrupt enable
  • SMBUS_IT_RXI RX interrupt enable
  • SMBUS_IT_TXI TX interrupt enable
Return values
None

◆ __HAL_SMBUS_ENABLE

#define __HAL_SMBUS_ENABLE (   __HANDLE__)    (SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE))

Enable the specified SMBUS peripheral.

Parameters
__HANDLE__specifies the SMBUS Handle.
Return values
None

◆ __HAL_SMBUS_ENABLE_IT

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

Enable the specified SMBUS interrupts.

Parameters
__HANDLE__specifies the SMBUS Handle.
__INTERRUPT__specifies the interrupt source to enable. This parameter can be one of the following values:
  • SMBUS_IT_ERRI Errors interrupt enable
  • SMBUS_IT_TCI Transfer complete interrupt enable
  • SMBUS_IT_STOPI STOP detection interrupt enable
  • SMBUS_IT_NACKI NACK received interrupt enable
  • SMBUS_IT_ADDRI Address match interrupt enable
  • SMBUS_IT_RXI RX interrupt enable
  • SMBUS_IT_TXI TX interrupt enable
Return values
None

◆ __HAL_SMBUS_GENERATE_NACK

#define __HAL_SMBUS_GENERATE_NACK (   __HANDLE__)    (SET_BIT((__HANDLE__)->Instance->CR2, I2C_CR2_NACK))

Generate a Non-Acknowledge SMBUS peripheral in Slave mode.

Parameters
__HANDLE__specifies the SMBUS Handle.
Return values
None

◆ __HAL_SMBUS_GET_FLAG

#define __HAL_SMBUS_GET_FLAG (   __HANDLE__,
  __FLAG__ 
)
Value:
(((((__HANDLE__)->Instance->ISR) & ((__FLAG__) & SMBUS_FLAG_MASK)) == \
((__FLAG__) & SMBUS_FLAG_MASK)) ? SET : RESET)
#define SMBUS_FLAG_MASK
Check whether the specified SMBUS flag is set or not.
Definition: stm32h7xx_hal_smbus.h:523

◆ __HAL_SMBUS_GET_IT_SOURCE

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

Check whether the specified SMBUS interrupt source is enabled or not.

Parameters
__HANDLE__specifies the SMBUS Handle.
__INTERRUPT__specifies the SMBUS interrupt source to check. This parameter can be one of the following values:
  • SMBUS_IT_ERRI Errors interrupt enable
  • SMBUS_IT_TCI Transfer complete interrupt enable
  • SMBUS_IT_STOPI STOP detection interrupt enable
  • SMBUS_IT_NACKI NACK received interrupt enable
  • SMBUS_IT_ADDRI Address match interrupt enable
  • SMBUS_IT_RXI RX interrupt enable
  • SMBUS_IT_TXI TX interrupt enable
Return values
Thenew state of IT (SET or RESET).

◆ __HAL_SMBUS_RESET_HANDLE_STATE

#define __HAL_SMBUS_RESET_HANDLE_STATE (   __HANDLE__)    ((__HANDLE__)->State = HAL_SMBUS_STATE_RESET)

Reset SMBUS handle state.

Parameters
__HANDLE__specifies the SMBUS Handle.
Return values
None

◆ SMBUS_FLAG_MASK

#define SMBUS_FLAG_MASK   (0x0001FFFFU)

Check whether the specified SMBUS flag is set or not.

Parameters
__HANDLE__specifies the SMBUS Handle.
__FLAG__specifies the flag to check. This parameter can be one of the following values:
  • SMBUS_FLAG_TXE Transmit data register empty
  • SMBUS_FLAG_TXIS Transmit interrupt status
  • SMBUS_FLAG_RXNE Receive data register not empty
  • SMBUS_FLAG_ADDR Address matched (slave mode)
  • SMBUS_FLAG_AF NACK received flag
  • SMBUS_FLAG_STOPF STOP detection flag
  • SMBUS_FLAG_TC Transfer complete (master mode)
  • SMBUS_FLAG_TCR Transfer complete reload
  • SMBUS_FLAG_BERR Bus error
  • SMBUS_FLAG_ARLO Arbitration lost
  • SMBUS_FLAG_OVR Overrun/Underrun
  • SMBUS_FLAG_PECERR PEC error in reception
  • SMBUS_FLAG_TIMEOUT Timeout or Tlow detection flag
  • SMBUS_FLAG_ALERT SMBus alert
  • SMBUS_FLAG_BUSY Bus busy
  • SMBUS_FLAG_DIR Transfer direction (slave mode)
Return values
Thenew state of FLAG (SET or RESET).